TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
GuiCanvas Class Reference

Inherits GuiControl.

## Public Member Functions
void | cursorOff ()
void | cursorOn ()
String | getBackgroundColor (...)
Integer | getContent ()
String | getCursorPos ()
Integer | getMouseControl ()
Boolean | getUseBackgroundColor (...)
void | hideCursor ()
Boolean | isCursorOn ()
void | popDialog (handle)
void | popLayer (layer)
void | pushDialog (handle[, layer])
void | renderFront (bool enable)
void | repaint ()
void | reset ()
void | resetCursor ()
void | setBackgroundColor (float red, float green, float blue, [float alpha=1.0])
void | setContent (handle)
void | setCursor (cursorHandle)
void | setCursorPos ()
void | setDoubleClickDelay ()
void | setDoubleClickMoveBuffer ()
void | setUseBackgroundColor (...)
void | showCursor ()
Public Member Functions inherited from GuiControl
void | addGuiControl (int controlId)
Integer | findHitControl (int x, int y)
String | getCenter ()
String | getExtent (...)
String | getGlobalCenter ()
String | getGlobalPosition ()
String | getMinExtent ()
Integer | getParent ()
String | getPosition ()
String | getValue ()
Boolean | isActive ()
Boolean | isAwake ()
Boolean | isVisible ()
void | makeFirstResponder (isFirst)
Boolean | pointInControl (int x, int y)
void | reorderChild (child1, child2)
void | resize (int x, int y, int w, int h)
void | setActive (isActive)
void | setCanSave (bool canSave)
void | setCenter (int x, int y)
void | setExtent (int width, int height)
void | setFirstResponder ()
void | setPosition (int x, int y)
void | setPositionGlobal (int x, int y)
void | setProfile (GuiControlProfile p)
void | setValue (value)
void | setVisible (isVisible)

## Member Function Documentation

void cursorOff | ( |  | ) |

Use the cursorOff method to disable the cursor.

Returns
  No return value

void cursorOn | ( |  | ) |

Use the cursorOn method to enable the cursor.

Returns
  No return value

String getBackgroundColor | ( |  | ... | ) |

Gets the background color for the canvas.

Returns
  (float red / float green / float blue / float alpha) The background color for the canvas.

Integer getContent | ( |  | ) |

Use the getContent method to get the ID of the control which is being used as the current canvas content.

Returns
  Returns the ID of the current canvas content (a control), or 0 meaning the canvas is empty

String getCursorPos | ( |  | ) |

Use the getCursorPos method to retrieve the current position of the mouse pointer.

Returns
  Returns a vector containing the ???x y??? coordinates of the cursor in the canvas

Integer getMouseControl | ( |  | ) |

Gets the gui control under the mouse.

Boolean getUseBackgroundColor | ( |  | ... | ) |

Gets whether the canvas background color is in use or not.

Returns
  Whether the canvas background color is in use or not.

void hideCursor | ( |  | ) |

Boolean isCursorOn | ( |  | ) |

void popDialog | ( | handle |  | ) |

Use the popDialog method to remove a currently showing dialog. If no handle is provided, the top most dialog is popped.

Parameters

  handle | The ID or a previously pushed dialog.

Returns
  No return value.

See also
  pushDialog, popLayer

void popLayer | ( | layer |  | ) |

Use the popLayer method to remove (close) all dialogs in the specified canvas ???layer???.

Parameters

  layer | A integer value in the range [ 0 , inf ) specifying the canvas layer to clear.

Returns
  No return value.

See also
  pushDialog, popDialog

void pushDialog | ( | handle | [, layer] | ) |

Use the pushDialog method to open a dialog on a specific canvas layer, or in the same layer the last openned dialog. Newly placed dialogs placed in a layer with another dialog(s) will overlap the prior dialog(s).

Parameters

  handle | The numeric ID or name of the dialog to be opened.
  layer | A integer value in the range [ 0 , inf ) specifying the canvas layer to place the dialog in.

Returns
  No return value

void renderFront | ( | bool | enable | ) |

void repaint | ( |  | ) |

Use the repaint method to force the canvas to redraw all elements.

Returns
  No return value

void reset | ( |  | ) |

Use the reset method to reset the current canvas update region.

Returns
  No return value

void resetCursor | ( |  | ) |

Returns the cursor to the system default.

Returns
  No return value

void setBackgroundColor | ( | float | red,
|  | float | green,
|  | float | blue
| ) |  |

Sets the background color for the canvas.

Parameters

  red | The red value.
  green | The green value.
  blue | The blue value.
  alpha | The alpha value.

Returns
  No return Value.

void setContent | ( | handle |  | ) |

Use the setContent method to set the control identified by handle as the current canvas content.

Parameters

  handle | The numeric ID or name of the control to be made the canvas contents.

Returns
  No return value

void setCursor | ( | cursorHandle |  | ) |

Use the setCursor method to select the current cursor.

Parameters

  cursorHandle | The ID of a previously defined GuiCursor object.

Returns
  No return value

void setCursorPos | ( |  | ) |

Use the setCursorPos method to set the position of the cursor in the cavas.

Parameters

  position | An y\ position vector specifying the new location of the cursor.

Returns
  No return value

void setDoubleClickDelay | ( |  | ) |

void setDoubleClickMoveBuffer | ( |  | ) |

void setUseBackgroundColor | ( |  | ... | ) |

Sets whether to use the canvas background color or not.

Parameters

  useBackgroundColor | Whether to use the canvas background color or not.

Returns
  No return value.

void showCursor | ( |  | ) |