Class Index | File Index

Classes


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.
Graphic({
   x: 10, y: 40,
   url: "http://www.tellurianring.com/images/logo-wordmark-version_100.png"
})
// Relative URL's work as well:
Graphic({
   x: 10, y: 10,
   url: "./images/ball.png"
})
// Scaling the image.
Graphic({
   x: 10, y: 50,
   scale_w: 100, scale_h: 26,
   url: "http://www.tellurianring.com/images/logo-wordmark-version.png"
})
Class Summary
Constructor Attributes Constructor Name and Description
 
Graphic(_details)
Fields borrowed from class SceneContent:
details
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
Graphic(_details)
Parameters:
{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)