Layer

A layer of components.

Constructors

this
this(size_t width, size_t height)

Creates a new layer.

Members

Functions

addComponent
void addComponent(Component component, string name)

Adds a component to the layer.

clear
void clear()

Clears the layer for its components.

getComponent
Component getComponent(string name)

Gets a component from the layer. You msut cast to the original component type for it to be useful.

keyPress
void keyPress(KeyboardKey key, bool stopEvent)

Handles key press events and delegates them to its components.

keyRelease
void keyRelease(KeyboardKey key, bool stopEvent)

Handles key release events and delegates them to its components.

mouseMove
void mouseMove(ptrdiff_t x, ptrdiff_t y, bool stopEvent)

Handles mouse move events and delegates them to its components.

mousePress
void mousePress(MouseButton button, bool stopEvent)

Handles mouse button press events and delegates them to its components.

mouseRelease
void mouseRelease(MouseButton button, bool stopEvent)

Handles mouse button release events and delegates them to its components.

refresh
void refresh(size_t width, size_t height)

Refreshes the layer and its components with a given width and height. Usually the resolution width and height.

removeComponent
void removeComponent(string name)

Removes a component from the layer.

render
void render(ExternalWindow window)

Will render the components of the layer to the given window.

Properties

height
size_t height [@property getter]

Gets the height of the layer. Usually the resolution height.

length
size_t length [@property getter]

Gets the amount of components within the layer.

width
size_t width [@property getter]

Gets the width of the layer. Usually the resolution width.

Meta