class

PointClickEngine::Graphics::UI::InventoryRenderer

Inherits Reference < Object

Inventory grid renderer

Constructors

new(columns : Int32 = 6, rows : Int32 = 4)
Source

Instance methods

add_item_sprite(item_id : String, sprite : Sprites::Sprite)

Add item sprite to cache

Source
background

Visual properties

Source
background=(background : NinePatch | Nil)

Visual properties

Source
background_color

Colors

Source
background_color=(background_color : RL::Color)

Colors

Source
columns

Grid properties

Source
columns=(columns : Int32)

Grid properties

Source
create_slots

Create inventory slots

Source
draw(x : Float32, y : Float32)

Draw inventory at position

Source
draw_centered(screen_width : Float32 = Display.reference_width.to_f32, screen_height : Float32 = Display.reference_height.to_f32)

Draw centered on screen

Source
highlight_color
Source
highlight_color=(highlight_color : RL::Color)
Source
highlight_slot(index : Int32 | Nil)

Highlight slot

Source
item_scale

Item rendering

Source
item_scale=(item_scale : Float32)

Item rendering

Source
load_item_sprite(item_id : String, texture_path : String)

Load item sprite

Source
padding
Source
padding=(padding : Float32)
Source
quantity_offset
Source
quantity_offset=(quantity_offset : RL::Vector2)
Source
rows
Source
rows=(rows : Int32)
Source
select_slot(index : Int32 | Nil)

Select slot

Source
selected_color
Source
selected_color=(selected_color : RL::Color)
Source
set_item(index : Int32, item_id : String | Nil, quantity : Int32 = 1)

Set item in slot

Source
set_item_at(column : Int32, row : Int32, item_id : String | Nil, quantity : Int32 = 1)

Set item in grid position

Source
show_quantity
Source
show_quantity=(show_quantity : Bool)
Source
slot_at(x : Float32, y : Float32) : Int32 | Nil

Get slot at position

Source
slot_background
Source
slot_background=(slot_background : NinePatch | Nil)
Source
slot_color
Source
slot_color=(slot_color : RL::Color)
Source
slot_highlight
Source
slot_highlight=(slot_highlight : NinePatch | Nil)
Source
slot_selected
Source
slot_selected=(slot_selected : NinePatch | Nil)
Source
slot_size
Source
slot_size=(slot_size : Float32)
Source
slot_spacing
Source
slot_spacing=(slot_spacing : Float32)
Source
slots

Slots

Source
total_height
Source
total_width

Get total size

Source