class Sketchbook::Group

Overview

Multiple Elements with a common origin (local coordinate system). Group can #adopt and #reject children dynamically.

Included Modules

Direct Known Subclasses

Defined in:

tree/group.cr

Instance Method Summary

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

def adopt(element : Element) #

Adds element as a child of this group.

WARNING this method does not link up this and element's intakes. Do this yourself explicitly or via an override.


[View source]
def bring_to_front(element : Element) #

Brings a child element in front of all others.

Does nothing if element is not a child of this group.


[View source]
def children : Array(Sketchbook::Element) #

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.


[View source]
def reject(element : Element) #

Removes element from this group.


[View source]
def render(target) #
Description copied from module Sketchbook::Element

Renders this element on the screen.


[View source]
def req #

Returns the minimum required size of this group: the position of the corner of its rightmost & bottommost element.


[View source]