Moscrif API Docs for: 2012q3
Show:

GameControl Class

include "lib://game2d/base/gameControl.ms";
Library: game2d

Generic game control class which creates onClick event. This class extends all buttons used in games.

Example:

class Button : GameControl
{
    ....
}

Methods

click

() protected

Method is called when the user clicks on the object.

init

() protected

Init Game control instance. This method should be used as a class constructor in extended classes. However, it is important to call parent's init method (by super.init()) to ensure correct object initialization.

pointerDragged

(
  • x
  • y
)
protected

Method is called when pointer moves on the screen.

Parameters:

  • x Integer

    X-coordinate in pixels from the left top screen corner

  • y Integer

    Y-coordinate in pixels from the left top screen corner

pointerPressed

(
  • x
  • y
)
protected

Method is called when pointer was pressed.

Parameters:

  • x Integer

    X-coordinate in pixels from the left top screen corner

  • y Integer

    Y-coordinate in pixels from the left top screen corner

pointerReleased

(
  • x
  • y
)
protected

Method is called when pointer was released. This method detects onClick event

Parameters:

  • x Integer

    X-coordinate in pixels from the left top screen corner

  • y Integer

    Y-coordinate in pixels from the left top screen corner

Events

onClick

The onClick event occurs when the user clicks on the object.