class GUI::Display

Overview

The top-most Component in the component hierarchy. The display manages input events, and solves the layout constraints.

Defined in:

display.cr

Constructors

Instance Method Summary

Instance methods inherited from class GUI::Component

animator : GUI::Animator animator, build(display : Component) build, children : Array(GUI::Component) children, children=(children : Array(GUI::Component)) children=, color : GUI::Color color, color=(color : GUI::Color) color=, each(&block : Component -> ) each, each_constraint(&block : Kiwi::Constraint -> ) each_constraint, intersects_point?(x, y) : Bool intersects_point?, on_hover(event : HoverEvent)
on_hover(&block : HoverEvent -> )
on_hover
, on_input(event : InputEvent)
on_input(&block : InputEvent -> )
on_input
, on_key_down(event : KeyDownEvent)
on_key_down(&block : KeyDownEvent -> )
on_key_down
, on_key_up(event : KeyUpEvent)
on_key_up(&block : KeyUpEvent -> )
on_key_up
, on_mouse_down(event : MouseDownEvent)
on_mouse_down(&block : MouseDownEvent -> )
on_mouse_down
, on_mouse_in(event : MouseInEvent)
on_mouse_in(&block : MouseInEvent -> )
on_mouse_in
, on_mouse_out(event : MouseOutEvent)
on_mouse_out(&block : MouseOutEvent -> )
on_mouse_out
, on_mouse_up(event : MouseUpEvent)
on_mouse_up(&block : MouseUpEvent -> )
on_mouse_up
, transformation(viewport_height vh, viewport_width vw) transformation

Constructor methods inherited from class GUI::Component

new(label : String)
new
new

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def add(block : Layout::Block) #

Adds a component to the hierarchy


[View source]
def build #

Loads all of the constraints from every component in this hierarchy into the solver. This should only be ran once.


[View source]
def height=(size) #

Changes the height of the display


[View source]
def on_input(event : InputEvent) #
Description copied from class GUI::Component

Executed on the "input" event.


[View source]
def solve #

Calculates the layout dimensions. This runs each time the screen is rendered


[View source]
def trigger_input(tick : RenderLoop::Tick, input : RenderLoop::Input) #

[View source]
def width=(size) #

Changes the width of the display


[View source]