|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--Button
Defined in example.lfo.jsui.js
| Field Summary | |
Boolean |
active
Whether or not this Button listens to GUI events (active state, deactivated state) |
String |
className
A string identifier for this class. |
Boolean |
clicked
Whether this Button was clicked. |
int |
clickedCount
Current number of frames (calls to draw()) that have elapsed while clicked state was true. |
int |
clickedHoldMax
How many frames (calls to draw()) elapse before the clicked state is reset. |
Array(4) |
color
Base OpenGL color of this Button - [R,G,B,A] |
Object |
data
The data (object) to broadcast to this Button's handler when clicked. |
Boolean |
debug
If non-zero, posts verbose debugging information to the Max window. |
Object |
handler
Reference to a handler object to broadcast UI events to |
Boolean |
hidden
Whether or not this Button should be drawn. |
Array(4) |
hitmask
Base OpenGL hitmask (mouse click overlay) color of this Button - [R,G,B,A] |
Array(4) |
inactivemask
Base OpenGL inactive state mask color of this Button - [R,G,B,A] |
Boolean |
mouseWasOver
Whether the mouse was positioned over this button last time we checked. |
Array(4) |
overmask
Base OpenGL overmask (mouse over overlay) color of this Button - [R,G,B,A] |
Array(2) |
scale
Scale of this Button in OpenGL world coordinates (x,y) |
Array(3) |
screenLocation
Location of this Button in screen coordinates (pixels) (x,y,z) (Top left corner of drawn Button) |
Array(2) |
size
Size of this Button in screen coordinates (pixels) (x,y) |
Boolean |
toggle
Whether this button holds after clicking until it's either clicked again or reset. |
Array(3) |
worldLocation
Location of this Button in OpenGL world coordinates (x,y,z) (Center of drawn Button) |
| Constructor Summary | |
Button
(<String> name, <Object> sketcher)
Simple Button classes for GUI events. |
|
| Method Summary | |
Button
|
clone()
Returns a new clone (a new Button object exactly like this one) |
void
|
draw(<Boolean> force)
Main OpenGL drawing routine for drawing this Button to the screen, using its internal reference to the jsui "sketch" object. |
void
|
drawBase()
Draw only basic button elements. |
void
|
drawClickedOverlay()
Draw blended overlay showing button was clicked. |
void
|
drawInactiveOverlay()
Draw blended overlay showing Button is not receiving UI events (not active). |
void
|
drawOverOverlay()
Draw blended overlay showing mouse is over Button. |
Boolean
|
getActive()
Get this Button's active state (if it is receiving mouse events) |
Object
|
getHandler()
Get reference tohandler obect for Button events |
Boolean
|
getHidden()
Get this Button's hidden state (if it should be drawn) |
Array(2)
|
getScale()
Get this Button's scale. |
Array(3)
|
getScreenLocation()
Get the location of this button in screen coordinates (pixels) |
Array(2)
|
getSize()
Get this Button's size (width, height) in pixels |
Array(3)
|
getWorldLocation()
Get the location of this button in world coords (OpenGL, for sketch) |
Object
|
hitTest(<int> x,<int> y)
Test if an x,y coordinate falls within the Button's boundaries. |
void
|
onclick(x,y,button,cmd,shift,capslock,option,ctrl)
Mouse click event handler |
void
|
ondblclick(x, y, button, mod1, shift, caps, opt, mod2)
Mouse double-click event handler |
void
|
ondrag(x, y, button, mod1, shift, caps, opt, mod2)
Mouse drag event handler |
void
|
onidle(x,y,button,cmd,shift,capslock,option,ctrl)
Mouse idle event handler |
void
|
onidleout(x, y, button, mod1, shift, caps, opt, mod2)
Mouse idleout event handler |
void
|
onresize()
Actions to perform when the Button is resized. |
void
|
push(<Boolean> showPush)
Manual/code-triggered mouse click event handler. |
void
|
setActive(<Boolean> state)
Sets this Button as active (receives mouse events) |
void
|
setClicked(<Boolean> state)
Set the clicked state of this Button, update GUI. |
void
|
setHandler(<Object> hobj)
Set reference to handler obect for Button events |
void
|
setHidden(<Boolean> state)
Sets this Button as hidden (not drawn) or not hidden (drawn) |
void
|
setScale(<int> sx,<int> sy)
Sets the scale (as in OpenGL, the scale is 2x the width of the drawn button) |
void
|
setScreenLocation(<int> x,<int> y,<int> z)
Set the location of this button in screen coordinates (pixels) |
void
|
setSize(<int> sx,<int> sy)
Sets the size of the button (width, height in pixels) |
void
|
setWorldLocation(<float> x,<float> y,<float> z)
Set the location of this button in world coords (OpenGL, for sketch) |
String
|
toString()
Return string representation of this object |
| Field Detail |
Boolean active
String className
Boolean clicked
int clickedCount
int clickedHoldMax
Array(4) color
Object data
Boolean debug
Object handler
Boolean hidden
Array(4) hitmask
Array(4) inactivemask
Boolean mouseWasOver
Array(4) overmask
Array(2) scale
Array(3) screenLocation
Array(2) size
Boolean toggle
Array(3) worldLocation
| Constructor Detail |
Button(<String> name, <Object> sketcher)
name - This will be the name of the button (a way of identifying it)
sketcher - The sketch object that will draw the button, associated with this jsui
| Method Detail |
Button clone()
void draw(<Boolean> force)
force - Force the drawing of the Button.
void drawBase()
void drawClickedOverlay()
void drawInactiveOverlay()
void drawOverOverlay()
Boolean getActive()
Object getHandler()
Boolean getHidden()
Array(2) getScale()
Array(3) getScreenLocation()
Array(2) getSize()
Array(3) getWorldLocation()
Object hitTest(<int> x,<int> y)
x - x-coordinate
y - y-coordinate
void onclick(x,y,button,cmd,shift,capslock,option,ctrl)
void ondblclick(x, y, button, mod1, shift, caps, opt, mod2)
void ondrag(x, y, button, mod1, shift, caps, opt, mod2)
void onidle(x,y,button,cmd,shift,capslock,option,ctrl)
void onidleout(x, y, button, mod1, shift, caps, opt, mod2)
void onresize()
void push(<Boolean> showPush)
showPush - Whether or not to show the push when drawing the Button to screen.
void setActive(<Boolean> state)
state - True if the Button should listen to events, false if it should ignore them.
void setClicked(<Boolean> state)
state - The new internal clicked state of the Button, true or false
void setHandler(<Object> hobj)
hobj - Handler object that will receive this Button's events.
void setHidden(<Boolean> state)
state - True if the Button will not be drawn
void setScale(<int> sx,<int> sy)
sx - x scale
sy - y scale
void setScreenLocation(<int> x,<int> y,<int> z)
x - x coordinate
y - y coordinate
z - z coordinate (optional)
void setSize(<int> sx,<int> sy)
sx - x size (pixels)
sy - y size (pixels)
void setWorldLocation(<float> x,<float> y,<float> z)
x - x coordinate
y - y coordinate
z - z coordinate
String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||