- addChild
void addChild(UIElement element)
Undocumented in source. Be warned that the author may not have intended to support it.
- animate
void animate(double dt, double time)
Undocumented in source. Be warned that the author may not have intended to support it.
- child
UIElement child(int n)
Undocumented in source. Be warned that the author may not have intended to support it.
- context
UIContext context()
Undocumented in source. Be warned that the author may not have intended to support it.
- getDrawList
void getDrawList(AlignedBuffer!UIElement list)
Appends the Elements that should be drawn, in order.
You should empty it before calling this function.
Everything visible get into the draw list, but that doesn't mean they
will get drawn if they don't overlap with a dirty area.
- isDragged
bool isDragged()
Undocumented in source. Be warned that the author may not have intended to support it.
- isFocused
bool isFocused()
Undocumented in source. Be warned that the author may not have intended to support it.
- isMouseOver
bool isMouseOver()
Undocumented in source. Be warned that the author may not have intended to support it.
- isVisible
bool isVisible()
Undocumented in source. Be warned that the author may not have intended to support it.
- keyDown
bool keyDown(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
- keyUp
bool keyUp(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
- mouseClick
bool mouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- mouseMove
void mouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- mouseRelease
void mouseRelease(int x, int y, int button, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- mouseWheel
bool mouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- onAnimate
void onAnimate(double dt, double time)
Called periodically.
Override this to create animations.
Using setDirty there allows to redraw an element continuously (like a meter or an animated object).
Warning: Summing dt will not lead to a time that increase like time.
time can go backwards if the window was reopen.
time is guaranteed to increase as fast as system time but is not synced to audio time.
- onBeginDrag
void onBeginDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
- onDraw
void onDraw(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)
Draw method. You should redraw the area there.
For better efficiency, you may only redraw the part in _dirtyRect.
diffuseMap and depthMap are made to span _position exactly,
so you can draw in the area (0 .. _position.width, 0 .. _position.height)
- onKeyDown
bool onKeyDown(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
- onKeyUp
bool onKeyUp(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
- onMouseClick
bool onMouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- onMouseDrag
void onMouseDrag(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- onMouseEnter
void onMouseEnter()
Undocumented in source. Be warned that the author may not have intended to support it.
- onMouseExit
void onMouseExit()
Undocumented in source. Be warned that the author may not have intended to support it.
- onMouseMove
void onMouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- onMouseWheel
bool onMouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
- onStopDrag
void onStopDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
- parent
UIElement parent()
- position
box2i position()
- position
box2i position(box2i p)
Forces the position of the element. It is typically used in the parent
reflow() method
- reflow
void reflow(box2i availableSpace)
Meant to be overriden almost everytime for custom behaviour.
Default behaviour is to span the whole area and reflow children.
Any layout algorithm is up to you.
Children elements don't need to be inside their parent.
- render
void render(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] areasToUpdate)
- setDirty
void setDirty(box2i rect)
Mark a part of the element dirty.
This part must be a subrect of the _position.
- setDirtyWhole
void setDirtyWhole()
Mark this element as wholly dirty.
- setVisible
void setVisible(bool visible)
Undocumented in source. Be warned that the author may not have intended to support it.
- setZOrder
void setZOrder(int zOrder)
Undocumented in source. Be warned that the author may not have intended to support it.
- topLevelParent
UIElement topLevelParent()
- zOrder
int zOrder()
Undocumented in source. Be warned that the author may not have intended to support it.
Base class of the UI widget hierarchy.