Description

Draws the image or part of the image

Usage

Parameters

  • img {String|Image|Canvas}

    If this is a string, this is the identifier of the preloaded image

  • sx {Integer} optional

    (optional)

  • sy {Integer} optional

    (optional)

  • sw {Integer} optional

    (optional)

  • sh {Integer} optional

    (optional)

  • dx {Integer} optional

    (optional)

  • dy {Integer} optional

    (optional)

  • dw {Integer} optional

    (optional)

  • dh {Integer} optional

    (optional)

Example

In the method "ready" in the scene class :

var el = this.createElement();
el.drawImage("img");

--

el.drawImage("img", 10, 30);

--

el.drawImage("img", 10, 30, 100, 100, 0, 0, 100, 100);

--

el.drawImage("img", 0, 0, "30%");

Discussion