class GUI::Component
- GUI::Component
- Reference
- Object
Included Modules
Direct Known Subclasses
Defined in:
component.crConstructors
Instance Method Summary
- #animator : GUI::Animator
-
#build(display : Component)
Override this to compose complex components.
- #children : Array(GUI::Component)
- #children=(children : Array(GUI::Component))
- #color : GUI::Color
- #color=(color : GUI::Color)
- #each(&block : Component -> )
-
#each_constraint(&block : Kiwi::Constraint -> )
Enumerate over all
Kiwi::Constraint
s in thisComponent
's hierarchy -
#intersects_point?(x, y) : Bool
Checks if the component intersects the point x, y
-
#on_hover(event : HoverEvent)
Executed on the "hover" event.
-
#on_hover(&block : HoverEvent -> )
Sets the callback to execute when the hover event is received.
-
#on_input(event : InputEvent)
Executed on the "input" event.
-
#on_input(&block : InputEvent -> )
Sets the callback to execute when the input event is received.
-
#on_key_down(event : KeyDownEvent)
Executed on the "key_down" event.
-
#on_key_down(&block : KeyDownEvent -> )
Sets the callback to execute when the key_down event is received.
-
#on_key_up(event : KeyUpEvent)
Executed on the "key_up" event.
-
#on_key_up(&block : KeyUpEvent -> )
Sets the callback to execute when the key_up event is received.
-
#on_mouse_down(event : MouseDownEvent)
Executed on the "mouse_down" event.
-
#on_mouse_down(&block : MouseDownEvent -> )
Sets the callback to execute when the mouse_down event is received.
-
#on_mouse_in(event : MouseInEvent)
Executed on the "mouse_in" event.
-
#on_mouse_in(&block : MouseInEvent -> )
Sets the callback to execute when the mouse_in event is received.
-
#on_mouse_out(event : MouseOutEvent)
Executed on the "mouse_out" event.
-
#on_mouse_out(&block : MouseOutEvent -> )
Sets the callback to execute when the mouse_out event is received.
-
#on_mouse_up(event : MouseUpEvent)
Executed on the "mouse_up" event.
-
#on_mouse_up(&block : MouseUpEvent -> )
Sets the callback to execute when the mouse_up event is received.
-
#transformation(viewport_height vh, viewport_width vw)
Generates the matrix transformation used for drawing the component within the viewpoint.
Macro Summary
Constructor Detail
Instance Method Detail
Override this to compose complex components.
You'll have access to the root display Component
so that
you can use the display dimensions in constraints if needed.
When composing your custom component you must add the sub-components to
@children
otherwise they won't be picked up by the constraint solver.
Example
def build(display : Component)
child = MySubComponent.new
# set some constraints...
@children << child
end
Enumerate over all Component
s in this Component
's hierarchy.
This first yields the component itself, then it's children.
Enumerate over all Kiwi::Constraint
s in this Component
's hierarchy
Sets the callback to execute when the hover event is received.
The block provided here will be executed within #on_hover
.
Sets the callback to execute when the input event is received.
The block provided here will be executed within #on_input
.
Sets the callback to execute when the key_down event is received.
The block provided here will be executed within #on_key_down
.
Sets the callback to execute when the key_up event is received.
The block provided here will be executed within #on_key_up
.
Sets the callback to execute when the mouse_down event is received.
The block provided here will be executed within #on_mouse_down
.
Sets the callback to execute when the mouse_in event is received.
The block provided here will be executed within #on_mouse_in
.
Sets the callback to execute when the mouse_out event is received.
The block provided here will be executed within #on_mouse_out
.
Sets the callback to execute when the mouse_up event is received.
The block provided here will be executed within #on_mouse_up
.
Generates the matrix transformation used for drawing the component within the viewpoint.