Sprite - notreux/UpsideEngine GitHub Wiki
Properties
table actions [read-only]
table layers [read-only]
number spriteSpeed
The time taken to change to next sprite
number zIndex
The rendering order of the object
boolean playing [read-only]
Returns if layers are playing
Vector2 size
The object size in the workspace
BaseClass:
Inherited fromstring class [read-only]
A read-only string representing the object class name
string name
Is the object name, can be used to identify multiple objects with the same class
number rotation
The object rotation at an angle
boolean loaded [read-only]
Returns if object is fully initialized
boolean canCollide
If object can collide with other objects
boolean visible
If object should be rendered
Vector2 position
The object position in the workspace
Methods
dictionary setParallax(Vector2 tileSize)
Returns a dictionary with 2 functions:
void rotate(Vector2): rotates the image
void disable(): disables the parallax mode
void play(string layerName, number speed)
Plays layers starting with layer(layerName) with speed of speed
void stop(string layerName)
Stops layers ending with layer(layerName)
void setLayer(string layerName, table images or string image, Vector2 rectSize [optional], table frames [optional])
Sets a new Layer/Animation for the object. To learn how the third and fourth parameter works please read this article.
BaseClass:
Inherited fromBaseObject extend(string className, table properties)
Can be used to create a new class
boolean hasTag(string tagName)
Retruns if object has a tag(tagName)
void addTag(string tagName)
Sets a tag(tagName) to the object
void removeTag(string tagName)
Removes the object tag(tagName) from the object
void applySymmetry()
Applies symmetry to the object
void destroy()
Destroys the object
void fire(eventName)
Fires event(eventName) in the object
Events
UEScriptSignal layerStarted(string layerName, table layers, Vector2 rectSize, table frames)
Fired when a layer is triggered
UEScriptSignal layerEnded(string layerName, table layers, Vector2 rectSize, table frames)
Fired when a layer is triggered ended
BaseClass:
Inherited fromUEScriptConnection destroyed()
Fired when the object is destroyed
UEScriptConnection loaded(boolean isLoaded)
Fired when a object is fully initialized
UEScriptSignal changed(string propertyName)
Fired when a property is changed in the object, propertyName is the property that has been changed
UEScriptSignal collision([BaseObject]((https://github.com/NotReux/UpsideEngine/wiki/BaseObject) hit)
Fired when a collision is detected in the object, doesn't fired if canCollide is disabled, hit is the object with which it collided
UEScriptSignal collisionEnded([BaseObject]((https://github.com/NotReux/UpsideEngine/wiki/BaseObject) hit)
Fired when a object finishes colliding with the object, hit is the the object with which it finishes colliding