Description

Displays a dialog box

Usage

Constructor

  • scene {CanvasEngine.Scene}

    Current scene

  • width {Integer}

    Width

  • height {Integer}

    Height

  • border {String} optional

    (optional) Identifier of the image to the border. The image must contain the four corners and four sides to have 9 tiles. The width and height should be divisible by three

Example

canvas.Scene.New({
    name: "MyScene",

    materials: {
        images: {
            "border": "images/window.png"
        }
    },

    ready: function(stage) {
        var box;
        this.window = canvas.Window.new(this, 230, 200, "border");

        box =  this.window.getBox();
        box.x = 50;
        box.y = 50;

        this.window.open(stage);

    }
});

Methods

size

Change the size of the window and rehabilitates borders depending on the size

position

Sets position to the window. If no parameter is assigned, the method returns the current position of the element in an object : {x: , y:}

setBackground

Sets the color and opacity of the background

getBox

Get the element representing the entire window

getContent

Retrieves the element representing the content (the center)

open

Adds the dialog on a parent element and displays the window on the screen

remove

`(>= 1.3.0)` Removes the window

Discussion