UIOnOffSwitch

Undocumented in source.

Constructors

this
this(UIContext context, BoolParameter param)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Enums

Orientation
enum Orientation
Undocumented in source.

Functions

onAnimate
void onAnimate(double dt, double time)
Undocumented in source. Be warned that the author may not have intended to support it.
onBeginParameterEdit
void onBeginParameterEdit(Parameter sender)
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)
Undocumented in source. Be warned that the author may not have intended to support it.
onEndParameterEdit
void onEndParameterEdit(Parameter sender)
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.
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.
onParameterChanged
void onParameterChanged(Parameter sender)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_param
BoolParameter _param;

The parameter this switch is linked with.

animationTimeConstant
float animationTimeConstant;
Undocumented in source.
depthHigh
ushort depthHigh;
Undocumented in source.
depthLow
ushort depthLow;
Undocumented in source.
diffuseOff
RGBA diffuseOff;
Undocumented in source.
diffuseOn
RGBA diffuseOn;
Undocumented in source.
holeDepth
ushort holeDepth;
Undocumented in source.
material
RGBA material;
Undocumented in source.
orientation
Orientation orientation;
Undocumented in source.

Inherited Members

From UIElement

~this
~this()
Undocumented in source.
render
void render(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] areasToUpdate)
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.

position
box2i position()
position
box2i position(box2i p)

Forces the position of the element. It is typically used in the parent reflow() method

child
UIElement child(int n)
Undocumented in source. Be warned that the author may not have intended to support it.
addChild
void addChild(UIElement element)
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.
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.
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.
onBeginDrag
void onBeginDrag()
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.
onStopDrag
void onStopDrag()
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.
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.
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.
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.
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.
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.
animate
void animate(double dt, double time)
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.
isVisible
bool isVisible()
Undocumented in source. Be warned that the author may not have intended to support it.
setVisible
void setVisible(bool visible)
Undocumented in source. Be warned that the author may not have intended to support it.
zOrder
int zOrder()
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.
setDirtyWhole
void setDirtyWhole()

Mark this element as wholly dirty.

setDirty
void setDirty(box2i rect)

Mark a part of the element dirty. This part must be a subrect of the _position.

parent
UIElement parent()
topLevelParent
UIElement topLevelParent()
isMouseOver
bool isMouseOver()
Undocumented in source. Be warned that the author may not have intended to support it.
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.
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.

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)

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.

_parent
UIElement _parent;

Parent element. Following this chain gets to the root element.

_position
box2i _position;

Position is the graphical extent An Element is not allowed though to draw further than its _position.

_children
AlignedBuffer!UIElement _children;
Undocumented in source.
_visible
bool _visible;

If _visible is false, neither the Element nor its children are drawn.

_zOrder
int _zOrder;

By default, every Element have the same z-order Because the sort is stable, tree traversal order is the default order (depth first).

From IParameterListener

onParameterChanged
void onParameterChanged(Parameter sender)

Called when a parameter value was changed You'll probably want to call setDirtyWhole() or setDirty() in it to make the graphics respond to host changing a parameter.

onBeginParameterEdit
void onBeginParameterEdit(Parameter sender)

Called when a parameter value start being changed due to an UI element

onEndParameterEdit
void onEndParameterEdit(Parameter sender)

Called when a parameter value stops being changed

Meta