Developer   API   Game Development   Game2D   Scene

Scene : BaseClass

Game scene, object to define a scene what can consist with layers, sprites or ame buttons.

Example

var tile = Bitmap.fromFile("app://tile.png"); // create new scane var menu = new Scene(); // create new layer var bg = new TiledLayer({ columns : 10, rows : 12, image : tile, tileHeight : tile.height, tileWidth : tile.width, }); // add layer to the scene menu.add(bg); // push scene to the game this.push(menu);

Properties

  • defaults : Object
    Sets default controls options.
  • options : Object
    Position of navigation bar.
  • this
    Construct of the object calls following method in order.

Methods

  • add(obj)
    Add object to the scene.
  • afterInitControls
    Method is executed after init controls.
  • beforeInit
    Init object parameters.
  • beforeInitControls
    Method is executed before init controls.
  • undefined(k,v)
    Special property executed when priperty is undefined. It can be that JSON format is in format "key" : "value". Key is an string, so if this is the case methot return "value". Ass well as k is a regular property of the class it returns getter of this property.

Events

  • onEnter(sender) : Function
    Event fired on enter to the scene.
  • onExit(sender) : Function
    Event fired on exit to the scene.