Class Index | File Index


Class Graphic

Extends SceneContent.
Draws an image into the Scene. The name "Graphic" was chosen over "Image" due to the native Javascript Image object. It had to be named something else, to avoid browser confusion as to which Image object we're actually creating. To create a Graphic, you need to supply it's location and url.
Defined in: Graphic.js.

// Using a remote image.
   x: 10, y: 40,
   url: ""
// Relative URL's work as well:
   x: 10, y: 10,
   url: "./images/ball.png"
// Scaling the image.
   x: 10, y: 50,
   scale_w: 100, scale_h: 26,
   url: ""
Class Summary
Constructor Attributes Constructor Name and Description
Fields borrowed from class SceneContent:
Methods borrowed from class SceneContent:
draw, extend, getBounds, getName, getParent, getScene, getStage, isActive, isVisible, load, loadBase, moveBy, moveTo, setActive, setSize, setVisible, update, updateBase
Class Detail
{Object} _details
A JSON object with the following properties:
Property Required Default
scale_h no
scale_w no
url yes

Documentation generated by JsDoc Toolkit 2.3.0 on Fri Oct 30 2009 09:09:10 GMT-0700 (PDT)