Class Button

Object
   |
   +--Button
Direct Known Subclasses:
IconButton, TextButton

class 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

active

Boolean active

className

String className

clicked

Boolean clicked

clickedCount

int clickedCount

clickedHoldMax

int clickedHoldMax

color

Array(4) color

data

Object data

debug

Boolean debug

handler

Object handler

hidden

Boolean hidden

hitmask

Array(4) hitmask

inactivemask

Array(4) inactivemask

mouseWasOver

Boolean mouseWasOver

overmask

Array(4) overmask

scale

Array(2) scale

screenLocation

Array(3) screenLocation

size

Array(2) size

toggle

Boolean toggle

worldLocation

Array(3) worldLocation

Constructor Detail

Button

Button(<String> name, <Object> sketcher)

Method Detail

clone

Button clone()

draw

void draw(<Boolean> force)

drawBase

void drawBase()

drawClickedOverlay

void drawClickedOverlay()

drawInactiveOverlay

void drawInactiveOverlay()

drawOverOverlay

void drawOverOverlay()

getActive

Boolean getActive()

getHandler

Object getHandler()

getHidden

Boolean getHidden()

getScale

Array(2) getScale()

getScreenLocation

Array(3) getScreenLocation()

getSize

Array(2) getSize()

getWorldLocation

Array(3) getWorldLocation()

hitTest

Object hitTest(<int> x,<int> y)

onclick

void onclick(x,y,button,cmd,shift,capslock,option,ctrl)

ondblclick

void ondblclick(x, y, button, mod1, shift, caps, opt, mod2)

ondrag

void ondrag(x, y, button, mod1, shift, caps, opt, mod2)

onidle

void onidle(x,y,button,cmd,shift,capslock,option,ctrl)

onidleout

void onidleout(x, y, button, mod1, shift, caps, opt, mod2)

onresize

void onresize()

push

void push(<Boolean> showPush)

setActive

void setActive(<Boolean> state)

setClicked

void setClicked(<Boolean> state)

setHandler

void setHandler(<Object> hobj)

setHidden

void setHidden(<Boolean> state)

setScale

void setScale(<int> sx,<int> sy)

setScreenLocation

void setScreenLocation(<int> x,<int> y,<int> z)

setSize

void setSize(<int> sx,<int> sy)

setWorldLocation

void setWorldLocation(<float> x,<float> y,<float> z)

toString

String toString()


Documentation generated by JSDoc on Wed Sep 6 11:55:06 2006