Touch Develop retirement postponed until June 22, 2019. Sign-in and access to cloud assets to be removed on May 23, 2018.Learn More..


Sprite

A sprite
function (Sprite) → acceleration x returns Number
Gets the acceleration along x in pixels/sec^2
function (Sprite) → acceleration y returns Number
Gets the acceleration along y in pixels/sec^2
function (Sprite) → angle returns Number
Gets the angle of the sprite in degrees
function (Sprite) → angular speed returns Number
Gets the rotation speed in degrees/sec
function (Sprite) → background returns Color
Gets the background color
function (Sprite) → bottom returns Number
Gets the bottom position in pixels
function (Sprite) → bubble returns Sprite
Gets the bubble sprite if any
function (Sprite) → color returns Color
Returns the sprite color.
function (Sprite) → create animation returns Sprite Animation
Starts a new tween animation.
function (Sprite) → delete
Delete sprite.
function (Sprite) → elasticity returns Number
Gets the sprite elasticity as a fraction of speed preservation per bounce (0-1)
function (Sprite) → equals(other : Sprite) returns Boolean
Are these the same sprite
function (Sprite) → fit text
Fits the bounding box to the size of the text
function (Sprite) → font size returns Number
Gets the font size in pixels (for text sprites)
function (Sprite) → friction returns Number
Gets the fraction of speed loss between 0 and 1
function (Sprite) → gradient returns Boolean
Gets the property that enables or disables gradients
function (Sprite) → height returns Number
Gets the height in pixels
function (Sprite) → hide
Hide sprite.
function (Sprite) → is deleted returns Boolean
True if sprite is deleted.
function (Sprite) → is invalid returns Boolean
Returns true if the current instance is useless
function (Sprite) → is visible returns Boolean
Returns true if sprite is not hidden
function (Sprite) → left returns Number
Gets the left position in pixels
function (Sprite) → location returns Location
Gets the geo location assigned to the sprite
function (Sprite) → mass returns Number
Gets the mass
function (Sprite) → move(delta x : Number, delta y : Number)
Moves sprite.
function (Sprite) → move towards(other : Sprite, fraction : Number)
Moves sprite towards other sprite.
function (Sprite) → on drag(dragged : Vector Action) returns Event Binding
Set the handler invoked when the sprite is dragged
function (Sprite) → on every frame(body : Action) returns Event Binding
Add an action that fires for every display frame
function (Sprite) → on swipe(swiped : Vector Action) returns Event Binding
Set the handler invoked when the sprite is swiped
function (Sprite) → on tap(tapped : Position Action) returns Event Binding
Set the handler invoked when the sprite is tapped
function (Sprite) → on touch down(touch down : Position Action) returns Event Binding
Set the handler invoked when the sprite is touched initially
function (Sprite) → on touch up(touch up : Position Action) returns Event Binding
Set the handler invoked when the sprite touch is released
function (Sprite) → opacity returns Number
Gets the opacity (between 0 transparent and 1 opaque)
function (Sprite) → overlaps with(other : Sprite) returns Boolean
Do the sprites overlap
function (Sprite) → overlap with(sprites : Sprite Set) returns Sprite Set
Returns the subset of sprites in the given set that overlap with sprite.
function (Sprite) → picture returns Picture
The picture on a picture sprite (if it is a picture sprite)
function (Sprite) → right returns Number
Gets the right position in pixels
function (Sprite) → say(text : String) returns Sprite
Displays a text bubble attached to the sprite and returns the bubble sprite.
function (Sprite) → scale returns Number
Gets the scaling applied when rendering the sprite. This scaling does not influence the bounding box.
function (Sprite) → set acceleration(x : Number, y : Number)
Sets the acceleration in pixels/sec^2
function (Sprite) → set acceleration x(x : Number)
Sets the x acceleration in pixels/sec^2
function (Sprite) → set acceleration y(y : Number)
Sets the y acceleration in pixels/sec^2
function (Sprite) → set angle(angle : Number)
Sets the angle of the sprite in degrees
function (Sprite) → set angular speed(speed : Number)
Sets the rotation speed in degrees/sec
function (Sprite) → set background(c : Color)
Sets the background color
function (Sprite) → set bottom(y : Number)
Sets the bottom position in pixels
function (Sprite) → set bubble(sprite : Sprite)
Sets the bubble sprite
function (Sprite) → set clip(left : Number, top : Number, width : Number, height : Number)
Sets the clipping area for an image sprite (if it is an image sprite)
function (Sprite) → set color(color : Color)
Sets the sprite color.
function (Sprite) → set elasticity(elasticity : Number)
Sets the sprite elasticity as a fraction of speed preservation per bounce (0-1)
function (Sprite) → set font size(size : Number)
Sets the font size in pixels of the sprite (for text sprites)
function (Sprite) → set friction(friction : Number)
Sets the friction to a fraction of speed loss between 0 and 1
function (Sprite) → set gradient(value : Boolean)
Sets gradient on or off
function (Sprite) → set height(height : Number)
Sets the height in pixels
function (Sprite) → set left(x : Number)
Sets the left position in pixels
function (Sprite) → set location(location : Location)
Sets the geo location of the sprite
function (Sprite) → set mass(mass : Number)
Sets the sprite mass.
function (Sprite) → set opacity(opacity : Number)
Sets the sprite opacity (between 0 transparent and 1 opaque).
function (Sprite) → set picture(pic : Picture)
Updates picture on a picture sprite (if it is a picture sprite)
function (Sprite) → set pos(x : Number, y : Number)
Sets the position in pixels
function (Sprite) → set right(x : Number)
Sets the right position in pixels
function (Sprite) → set scale(value : Number)
Sets the scaling applied to the sprite on rendering. This scaling does not influence the bounding box.
function (Sprite) → set shadow(blur : Number, color : Color, x offset : Number, y offset : Number)
Sets the shadow information
function (Sprite) → set speed(vx : Number, vy : Number)
Sets the speed in pixels/sec
function (Sprite) → set speed x(vx : Number)
Sets the x speed in pixels/sec
function (Sprite) → set speed y(vy : Number)
Sets the y speed in pixels/sec
function (Sprite) → set text(text : String)
Updates text on a text sprite (if it is a text sprite)
function (Sprite) → set text baseline(pos : String)
Sets the current text baseline used when drawing text (for text sprites)
function (Sprite) → set top(y : Number)
Sets the top position in pixels
function (Sprite) → set width(width : Number)
Sets the width in pixels
function (Sprite) → set x(x : Number)
Sets the center horizontal position in pixels
function (Sprite) → set y(y : Number)
Sets the y position in pixels
function (Sprite) → set z index(zindex : Number)
Sets the z-index of the sprite
function (Sprite) → sheet returns Sprite Sheet
Gets the associated sprite sheet
function (Sprite) → show
Show sprite.
function (Sprite) → speed towards(other : Sprite, magnitude : Number)
Sets sprite speed direction towards other sprite with given magnitude.
function (Sprite) → speed x returns Number
Gets the speed along x in pixels/sec
function (Sprite) → speed y returns Number
Gets the speed along y in pixels/sec
function (Sprite) → text returns String
The text on a text sprite (if it is a text sprite)
function (Sprite) → text baseline returns String
Gets the current text baseline (for text sprites)
function (Sprite) → top returns Number
Gets the top position in pixels
function (Sprite) → width returns Number
Gets the width in pixels
function (Sprite) → x returns Number
Gets the center horizontal position of in pixels
function (Sprite) → y returns Number
Gets the y position in pixels
function (Sprite) → z index returns Number
Gets the z-index of the sprite

edit this topic rkzkfdmlde