class Sketchbook::Group
- Sketchbook::Group
- Reference
- Object
Overview
Multiple Element
s with a common origin (local coordinate
system). Group can #adopt
and #reject
children dynamically.
Included Modules
Direct Known Subclasses
Defined in:
tree/group.crInstance Method Summary
-
#adopt(element : Element)
Adds element as a child of this group.
-
#bring_to_front(element : Element)
Brings a child element in front of all others.
-
#children : Array(Sketchbook::Element)
Returns the children of this group.
-
#reject(element : Element)
Removes element from this group.
-
#render(target)
Renders this element on the screen.
-
#req
Returns the minimum required size of this group: the position of the corner of its rightmost & bottommost element.
Instance methods inherited from module Sketchbook::Element
adopted
adopted,
bounds : Rect
bounds,
bring_to_front
bring_to_front,
drag(stream = events) : Stream(Point)
drag,
enter(stream = events) : Stream(Point)
enter,
events : Stream(SF::Event)
events,
input(stream = events) : Stream(Char)
input,
intake
intake,
keypress(stream = events) : Stream(SF::Event::KeyPressed)
keypress,
keys(stream = events) : Stream(SF::Event::KeyEvent)
keys,
leave(stream = events) : Stream(Point)
leave,
mouse_press(stream = events) : Stream(SF::Event::MouseButtonPressed)
mouse_press,
offset
offset,
offset=(offset)
offset=,
parent : Group | Nil
parent,
parent=(parent : Group | Nil)
parent=,
parent? : Group | Nil | Nil
parent?,
pos(accum = offset)
pos,
rejected
rejected,
render(target)
render,
req
req,
size
size,
size=(size)
size=,
transit(stream = events) : Stream(Tuple(Point, Bool))
transit
Instance Method Detail
Adds element as a child of this group.
WARNING this method does not link up this and element's
intake
s. Do this yourself explicitly or via an override.
Brings a child element in front of all others.
Does nothing if element is not a child of this group.
Returns the children of this group. The more right an element is, the greater its Z index is (it will appear on top of the elements before it). The last element is considered frontmost.
Renders this element on the screen.
Returns the minimum required size of this group: the position of the corner of its rightmost & bottommost element.