Skip to content

Menus Customization

alexguirre edited this page Aug 11, 2020 · 4 revisions

Table of Contents

  1. Banners
  2. Colors
  3. Text Styles

Banners

Banners can be changed with the UIMenu.SetBannerType and UIMenu.RemoveBanner methods.

Game Sprite

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));

Single Color

The overload UIMenu.SetBannerType(Color) allows to change the banner to single color rectangle.

menu.SetBannerType(Color.FromArgb(255, 200, 10, 10));

Custom Texture

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);

No Banner

UIMenu.RemoveBanner() allows to remove the banner completely.

menu.RemoveBanner();

Colors

TBD

Text Styles

TBD