-
Notifications
You must be signed in to change notification settings - Fork 38
Menus Customization
alexguirre edited this page Aug 11, 2020
·
4 revisions
Banners can be changed with the UIMenu.SetBannerType
and UIMenu.RemoveBanner
methods.
The overload UIMenu.SetBannerType(Sprite)
allows to use images from texture dictionaries (.ytd) as the banner.
menu.SetBannerType(new Sprite("commonmenu", "interaction_bgd", Point.Empty, Size.Empty));
The overload UIMenu.SetBannerType(Color)
allows to change the banner to single color rectangle.
menu.SetBannerType(Color.FromArgb(255, 200, 10, 10));
The overload UIMenu.SetBannerType(Rage.Texture)
allows to change the banner to an external image, loaded using Game.CreateTextureFromFile(string)
. If this banner type is used, MenuPool.DrawBanners(Rage.Graphics)
or UIMenu.DrawBanner(Rage.Graphics)
must be called from the Game.RawFrameRender
event.
menu.SetBannerType(Game.CreateTextureFromFile("custom-banner.png"));
Game.RawFrameRender += (s, e) => pool.DrawBanners(e.Graphics);
UIMenu.RemoveBanner()
allows to remove the banner completely.
menu.RemoveBanner();
TBD
TBD