Torque2D Reference
Loading...
Searching...
No Matches

Classes

class  GuiControl

Detailed Description

Introduction

GuiControl is the base class for GUI controls in Torque. It provides these basic areas of functionality:

  • Inherits from SimGroup, so that controls can have children.
  • Interfacing with a GuiControlProfile.
  • An abstraction from the details of handling user input and so forth, providing friendly hooks like onMouseEnter(), onMouseMove(), and onMouseLeave(), onKeyDown(), and so forth.
  • An abstraction from the details of rendering and resizing.
  • Helper functions to manipulate the mouse (mouseLock and mouseUnlock), and convert coordinates (localToGlobalCoord() and globalToLocalCoord()).

GUI has an overview of the GUI system.

Tickable Information - taken from guiTickCtrl now retired. This Gui Control is designed to recieve update ticks at a constant interval. It was created to be the Parent class of a control which used a DynamicTexture along with a VectorField to create warping effects much like the ones found in visualization displays for iTunes or Winamp. Those displays are updated at the framerate frequency. This works fine for those effects, however for an application of the same type of effects for things like Gui transitions the framerate-driven update frequency is not desireable because it does not allow the developer to be able to have any idea of a consistant user-experience.

Enter the Tickable interface. This lets the Gui control, in this case, update the dynamic texture at a constant rate of once per tick, even though it gets rendered every frame, thus creating a framerate-independant update frequency so that the effects are at a consistant speed regardless of the specifics of the system the user is on. This means that the screen-transitions will occur in the same time on a machine getting 300fps in the Gui shell as a machine which gets 150fps in the Gui shell.

See also
Tickable