assets

From Teverse

Assets is a property of engine and is the main container for some of the core components of a game. Assets is a singleton that can be accessed via engine.assets. Children cannot be added to this class.

Properties

lua [readonly]

Type: luaFolder
This Lua folder contains the luaServerFolder, luaClientFolder and luaSharedFolder

Inherited from the base class:

name

Type: string
A none unique identifier

className [readonly]

Type: string
The name of the object’s class

id [readonly][restricted]

Type: number
A unique identifier used internally, use is not recommended as this may be nil

children [readonly]

Type: table
A readonly table of child objects, a reference to this table will not remain up to date

Methods

Inherited from the base class:

destroy

nil assets:destroy()
Locks the object before removing it from the hierarchy. Children will also be destroyed.

destroyAllChildren

nil assets:destroyAllChildren()
Calls the destroy method on each child of this instance.

isContainer

string assets:isContainer()
Locks the object before removing it from the hierarchy.

clone

variant assets:clone()
Constructs a new object with the same properties, this will only work on classes that you are able to create manually.

hasChild

variant assets:hasChild(string childName)
If a child with the name specified is found, that child is returned. Otherwise this returns nil.

isDescendantOf

boolean assets:isDescendantOf(baseClass ancestor)
Returns true if this object is a descendant of ancestor.

Events

Inherited from the base class:

changed

eventListener assets:changed(function(string property, variant value))
Fired when a property of this object is changed. Returns the property that was changed and the new value.

childAdded

eventListener assets:childAdded(function(variant child))
Fired when child is parented to this.