class

PointClickEngine::UI::MenuRenderer

Inherits Reference < Object

Handles visual rendering for menu systems

The MenuRenderer centralizes all rendering logic for menus including:

  • Background and border rendering
  • Text rendering with positioning
  • Highlight effects and animations
  • Layout calculations and positioning

Constructors

Instance methods

animate_fade_in(duration : Float32 = 0.3)

Animates fade in effect

Source
animate_fade_out(duration : Float32 = 0.3)

Animates fade out effect

Source
animation
Source
animation=(animation : AnimationState)
Source
apply_fade(color : RL::Color) : RL::Color

Applies fade effect to color

Source
apply_highlight(color : RL::Color) : RL::Color

Applies highlight pulse effect to color

Source
auto_size
Source
auto_size=(auto_size : Bool)
Source
calculate_content_bounds(bounds : RL::Rectangle) : RL::Rectangle

Calculates content area within menu bounds

Source
calculate_menu_size(title : String, items : Array(String)) : RL::Vector2

Calculates required size for menu content

Source
center_horizontally

Layout configuration

Source
center_horizontally=(center_horizontally : Bool)

Layout configuration

Source
center_vertically
Source
center_vertically=(center_vertically : Bool)
Source
draw_background(bounds : RL::Rectangle)

Draws menu background with theme styling

Source
draw_border(bounds : RL::Rectangle)

Draws menu border with theme styling

Source
draw_menu(bounds : RL::Rectangle, title : String, items : Array(String), selected_index : Int32, enabled_items : Array(Bool) | Nil = nil)

Renders a complete menu with background, title, and items

  • bounds : Rectangle defining the menu area
  • title : Menu title text
  • items : Array of menu item texts
  • selected_index : Currently selected item index
  • enabled_items : Array indicating which items are enabled
Source
draw_menu_item(content_bounds : RL::Rectangle, text : String, y : Float32, is_selected : Bool, is_enabled : Bool)

Draws individual menu item with proper styling

Source
draw_menu_items(content_bounds : RL::Rectangle, start_y : Float32, items : Array(String), selected_index : Int32, enabled_items : Array(Bool) | Nil = nil)

Draws menu items with selection highlighting

Source
draw_selection_background(x : Float32, y : Float32, width : Float32, height : Float32)

Draws background highlight for selected items

Source
draw_title(content_bounds : RL::Rectangle, title : String) : Int32

Draws menu title with proper positioning

Returns: Height of the drawn title

Source
enable_animations

Animation settings

Source
enable_animations=(enable_animations : Bool)

Animation settings

Source
fade_speed
Source
fade_speed=(fade_speed : Float32)
Source
get_item_bounds(menu_bounds : RL::Rectangle, title : String, item_index : Int32) : RL::Rectangle

Gets menu item bounds for interaction detection

Source
get_theme_config

Gets current theme as configuration hash

Source
pulse_speed
Source
pulse_speed=(pulse_speed : Float32)
Source
set_fade_alpha(alpha : Float32)

Sets fade animation state

Source
theme

Current theme and animation state

Source
theme=(theme : MenuTheme)

Current theme and animation state

Source
update_animations

Updates animation states

Source
update_theme_from_config(config : Hash(String, String))

Updates theme from configuration

Source
validate_theme

Validates theme configuration

Source

Nested types