Class R.resources.types.Level
Extends
R.engine.BaseObject.
Creates an instance of a Level object.
Defined in: level.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.resources.types.Level(name, levelResource)
|
Method Attributes | Method Name and Description |
---|---|
addResourceLoader(resourceLoader)
Add a new resource loader to the set of resource loaders that the
level has access to.
|
|
Gets the class name of this object.
|
|
Get the height of the level, in tiles.
|
|
Get the version number associated with the level
|
|
getWidth()
Get the width of the level, in tiles.
|
|
release()
Release the level back into the pool for reuse
|
|
serialize(level)
Generate an object which represents the level as a complete
entity, including resource locations.
|
|
setRenderContext(renderContext)
Associate the level with its render context so the tile maps can
be rendered properly.
|
|
setVersion(version)
Set a version number for the level.
|
- Methods borrowed from class R.engine.BaseObject:
- addEvent, addEvents, destroy, getElement, jQ, removeEvent, setElement, triggerEvent, update
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.resources.types.Level(name, levelResource)
- Parameters:
- name
- {String} The name of the object
- levelResource
- {Object} The level resource loaded by the LevelLoader
Method Detail
addResourceLoader(resourceLoader)
Add a new resource loader to the set of resource loaders that the
level has access to. By default, there is already a sprite and
tile loader when a level object is created.
- Parameters:
- resourceLoader
- {R.resources.loaders.AbstractResourceLoader} The resource loader to add
{String}
getClassName()
Gets the class name of this object.
- Returns:
- {String} The string "R.resources.types.Level"
{Number}
getHeight()
Get the height of the level, in tiles.
- Returns:
- {Number} The height of the level in tiles
{Number}
getVersion()
Get the version number associated with the level
- Returns:
- {Number}
{Number}
getWidth()
Get the width of the level, in tiles.
- Returns:
- {Number} The width of the level in tiles
release()
Release the level back into the pool for reuse
{Object}
serialize(level)
Generate an object which represents the level as a complete
entity, including resource locations.
- Parameters:
- level
- {R.resources.types.Level}
- Returns:
- {Object}
setRenderContext(renderContext)
Associate the level with its render context so the tile maps can
be rendered properly.
- Parameters:
- renderContext
- {R.rendercontexts.AbstractRenderContext}
setVersion(version)
Set a version number for the level.
- Parameters:
- version
- {Number} A version number