Class RadialMenu
Class defined in:src/node-radialmenu.js:24
Class RadialMenu
addRadialMenuButton( name, icon, iconScale, dim, alignment, radialAnglePos, radialLevel )
public/src/radialMenu.js:117
Helper function for creating radial menu buttons
Parameters:-
name<String>name of the button
-
icon<Image>icon image for the button
-
iconScale<Float>scale factor for icon
-
dim<ButtonSize: float, hitboxSize: float>} object specifying the button display and hitbox size
-
alignment<String>where the center of the button is defined 'left' (default) or 'centered'
-
radialAnglePos<Float>position of the button along the radius. based on angleSeparation and initAngle
-
radialLevel<Float>radial level of button (0 = center, 1 = standard icons, 2 = secondary icons)
the ButtonWidget object created
createRadialButton( icon, useBackgroundColor, buttonSize, hitboxSize, alignment, hitboxShape, radialPos, buttonRadius )
public/src/radialMenu.js:278
Helper function for creating a radial button (more generic than addRadialMenuButton)
Parameters:-
icon<Image>icon image for the button
-
useBackgroundColor<Boolean> -
buttonSize<Float>size of the button in pixels
-
hitboxSize<Float>size of the button hitbox in pixels
-
alignment<String>where the center of the button is defined "left" (default) or "centered"
-
hitboxShape<String>shape of the hitbox "box" or "circle"
-
radialPos<Float>position of the button along the radius. based on angleSeparation and initAngle
-
buttonRadius<Float>distance from the center of the menu
the ButtonWidget object created
createRadialButton( buttonID, state )
public/src/radialMenu.js:263
Sets the state of a radial menu button
Parameters:drawImage( ctx, image, position, size, color, rotation, centered )
public/src/radialMenu.js:314
Helper function for drawing an image
Parameters:-
ctx<Context>context to draw on
-
image<Image>image to draw
-
position<X: Float, y: Float>position to draw
-
size<X: Float, y: Float>width, height of image
-
color<Color>fill color to use
-
rotation<Float>rotation of the image (not currently used)
-
centered<Boolean>is the center of the image the origin for positioning
generateGeometry( interactMgr )
src/node-radialmenu.js:171
Adds geometry to the Interaction module
Parameters:-
interactMgr<Object>Interaction manager
getShortButtonName( longButtonName )
src/node-radialmenu.js:348
Gets the short name of a button given the long name
Parameters:-
longButtonName<Object>
init( data, thumbElem, thumbElem2 )
public/src/radialMenu.js:156
Initialization
Parameters:-
data<id: this.pointerid, x: this.left, y: this.top, radialMenuSize: this.radialMenuSize,!~YUIDOC_LINE~! thumbnailWindowSize: this.thumbnailWindowSize, radialMenuScale: this.radialMenuScale,!~YUIDOC_LINE~! visble: this.visible>Radial menu info from node-radialMenu
-
thumbElem<Element>DOM element for the thumbnail content window
-
thumbElem2<Element>DOM element for the metadata window (not currently implemented)
isDragging( id, localPos )
src/node-radialmenu.js:604
Checks if an input ID is dragging the menu
Parameters:-
id<Integer>input ID
-
localPos<X: Float, y: Float>input position
dragPos
isThumbnailWindowOpen( )
src/node-radialmenu.js:359
Returns if the thumbnail window is currently open
openState
loadApplication( data, user )
public/src/radialMenu.js:1004
Tells the server to start an application
Parameters:-
data<Object>Application information like filename
-
user<Integer>userID
loadFileFromServer( data, user )
public/src/radialMenu.js:991
Tells the server to load a file
Parameters:-
data<Object>Content information like type and filename
-
user<Integer>userID
moveMenu( data, offset )
public/src/radialMenu.js:784
Moves the radial menu based on master and server events
Parameters:-
data<x: data.x, y: data.y, windowX: rect.left, windowY: rect.top>Contains the event position and the bounding rectangle -
offset<x: this.offsetX, y: this.offsetY>Contains the display client offset
onButtonEvent( buttonID, pointerID )
src/node-radialmenu.js:238
Parameters:
stateChange -1 = no change, 0 = now idle, 1 = now mouse over, 2 = now clicked
onEvent( type, position, user, data )
public/src/radialMenu.js:812
Processes events
Parameters:-
type<String>i.e. "pointerPress", "pointerMove", "pointerRelease"
-
position<X: Float, y: Float>event position
-
user<Integer>userID
-
data<Button: "left/right", color: "#000000">
onMenuEvent( pointerID )
src/node-radialmenu.js:319
Parameters:
-
pointerID<Object>
stateChange
onStartDrag( id, localPos )
src/node-radialmenu.js:589
Initializes the radial menu's drag state
Parameters:-
id<Integer>input ID initiating the drag
-
localPos<X: Float, y: Float>initial drag position
setState( stateData )
public/src/radialMenu.js:1324
Sets the state of the radial menu: buttons, content windows
Parameters:-
stateData<Object>node-radialMenu.js getInfo()
setThumbnailPosition( thumbnailSourceList, imageThumbnailSize, thumbSpacer, maxRows, neededColumns )
public/src/radialMenu.js:1219
Helper function for arranging thumbnails
Parameters:-
thumbnailSourceList<Object>List of thumbnails
-
imageThumbnailSize<Float>width of thumbnail in pixels
-
thumbSpacer<Float>space between thumbnails in pixels
-
maxRows<Integer>maximum thumbnails per row
-
neededColumns<Integer>calculated number of columns needed
updateFileList( serverFileList )
public/src/radialMenu.js:1017
Receives the current asset list from server
Parameters:-
serverFileList<Object>Server file list
SAGE2: RadialMenu