A renderizable model. More...
Public Member Functions | |
Model (var path) | |
Create a Model from path. | |
render () | |
Render this model. | |
Public Attributes | |
var | x |
Coordinate X. | |
var | y |
Coordinate Y. | |
var | transparency |
Transparency. | |
var | rotation |
Rotation. | |
var | scaleX |
Scale X. | |
var | scaleY |
Scale Y. | |
A renderizable model.
A Model is associated to an image it has a position, a rotation, a transparency and a scale.
It can be rendered at any time.
GameEngine.Renderer.Model.Model | ( | var | path | ) |
Create a Model from path.
Create a new Model, path is the url of an image or the image in base64 notation.
Generate models before starting game with GameEngine.startGame() to prevent lag.
path | The path or base64 notation of an image. |
GameEngine.Renderer.Model.render | ( | ) |
Render this model.
Make model be rendered instantly.
var GameEngine.Renderer.Model.rotation |
Rotation.
Rotation of the model in radians.
var GameEngine.Renderer.Model.scaleX |
Scale X.
This is the ratio of model image width with model size on the screen.
var GameEngine.Renderer.Model.scaleY |
Scale Y.
This is the ratio of model image height with model size on the screen.
var GameEngine.Renderer.Model.transparency |
Transparency.
Between 0 (Completely hidden) and 1 (Fully visible).
var GameEngine.Renderer.Model.x |
Coordinate X.
The X coordinate on the screen of the model (from center point).
var GameEngine.Renderer.Model.y |
Coordinate Y.
The Y coordinate on the screen of the model (from center point).