class Works::InventoryHUD

Defined in:

works/inventory_hud.cr

Constant Summary

BackgroundColor = LibAllegro.premul_rgba_f(0, 0, 0, 0.13)
HoverColor = LibAllegro.premul_rgba_f(1, 0.5, 0, 0.33)
Margin = 4 * Screen.scale_factor
SlotBackgroundColor = LibAllegro.premul_rgba_f(1, 1, 1, 0.13)
SlotBorderColor = LibAllegro.premul_rgba_f(0, 0, 0, 0.03)
SlotCols = 10
SlotSize = 32 * Screen.scale_factor

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(items : Array(Item::Base), max_slots : Int32) #

[View source]

Class Method Detail

def self.draw_slot(dx, dy, item : Item::Base | Nil, hovering = false) #

[View source]
def self.item_size #

[View source]

Instance Method Detail

def draw #

[View source]
def draw_background #

[View source]
def draw_slot(dx, dy, item : Item::Base | Nil, hovering = false) #

[View source]
def draw_slots #

[View source]
def height #

[View source]
def hide #

[View source]
def hover?(mouse : Mouse) #

[View source]
def hover? : Bool #

[View source]
def hover_index : Int32 | Nil #

[View source]
def inventory_width #

[View source]
def item_col(index) #

[View source]
def item_cols #

[View source]
def item_row(index) #

[View source]
def item_rows #

[View source]
def item_size #

[View source]
def item_x(col) #

[View source]
def item_y(row) #

[View source]
def items : Array(Works::Item::Base) #

[View source]
def max_slots : Int32 #

[View source]
def show #

[View source]
def show_toggle #

[View source]
def shown? : Bool #

[View source]
def update(keys : Keys, mouse : Mouse) #

[View source]
def update_hover(mouse : Mouse) #

[View source]
def update_hover_index(mouse : Mouse) #

[View source]
def width #

[View source]
def x #

[View source]
def y #

[View source]