Skip to content

Class: Sprite

Extends

Constructors

Constructor

new Sprite(): Sprite

Returns

Sprite

Overrides

Component.constructor

Properties

MAX_ELAPSE

MAX_ELAPSE: number = Infinity

Inherited from

Component.MAX_ELAPSE

Methods

alpha()

alpha(a, ta?): Sprite

Parameters

a

number

ta?

number

Returns

Sprite

Inherited from

Component.alpha


append()

Call Signature

append(...child): this

Parameters
child

...Component[]

Returns

this

Inherited from

Component.append

Call Signature

append(child): this

Parameters
child

Component[]

Returns

this

Inherited from

Component.append


appendTo()

appendTo(parent): Sprite

Parameters

parent

Component

Returns

Sprite

Inherited from

Component.appendTo


attr()

Call Signature

attr(name, value): this

Parameters
name

string

value

any

Returns

this

Inherited from

Component.attr

Call Signature

attr(name): any

Parameters
name

string

Returns

any

Inherited from

Component.attr


clearTimeout()

clearTimeout(timer): void

Parameters

timer

ComponentTickListener<Sprite>

Returns

void

Inherited from

Component.clearTimeout


column()

column(align): Sprite

Parameters

align

number

Returns

Sprite

Inherited from

Component.column


direction()

direction(direction, align): Sprite

Parameters

direction

"row" | "column"

align

number

Returns

Sprite

Inherited from

Component.direction


empty()

empty(): Sprite

Returns

Sprite

Inherited from

Component.empty


first()

first(visible?): Component

Parameters

visible?

boolean

Returns

Component

Inherited from

Component.first


height()

Call Signature

height(h): this

Parameters
h

number

Returns

this

Inherited from

Component.height

Call Signature

height(): number

Returns

number

Inherited from

Component.height


hide()

hide(): Sprite

Returns

Sprite

Inherited from

Component.hide


image()

image(frame): Sprite

Parameters

frame

TextureSelectionInput

Returns

Sprite

Deprecated


insertAfter()

insertAfter(prev): Sprite

Parameters

prev

Component

Returns

Sprite

Inherited from

Component.insertAfter


insertBefore()

insertBefore(next): Sprite

Parameters

next

Component

Returns

Sprite

Inherited from

Component.insertBefore


insertNext()

insertNext(sibling, more?): Sprite

Parameters

sibling

Component

more?

Component

Returns

Sprite

Inherited from

Component.insertNext


insertPrev()

insertPrev(sibling, more?): Sprite

Parameters

sibling

Component

more?

Component

Returns

Sprite

Inherited from

Component.insertPrev


label()

Call Signature

label(): string

Returns

string

Inherited from

Component.label

Call Signature

label(label): this

Parameters
label

string

Returns

this

Inherited from

Component.label


last()

last(visible?): Component

Parameters

visible?

boolean

Returns

Component

Inherited from

Component.last


listeners()

listeners(type): ComponentEventListener<Component>[]

Parameters

type

string

Returns

ComponentEventListener<Component>[]

Inherited from

Component.listeners


matrix()

matrix(relative?): Matrix

Parameters

relative?

boolean = false

Returns

Matrix

Inherited from

Component.matrix


maximize()

maximize(): Sprite

Set size to match parent size.

Returns

Sprite

Inherited from

Component.maximize


minimize()

minimize(): Sprite

Set size to match largest child size.

Returns

Sprite

Inherited from

Component.minimize


next()

next(visible?): Component

Parameters

visible?

boolean

Returns

Component

Inherited from

Component.next


off()

off(types, listener): this

Parameters

types

string

listener

ComponentEventListener<Sprite>

Returns

this

Inherited from

Component.off


offset()

Call Signature

offset(value): this

Parameters
value

Vec2Value

Returns

this

Inherited from

Component.offset

Call Signature

offset(x, y): this

Parameters
x

number

y

number

Returns

this

Inherited from

Component.offset


on()

on(types, listener): this

Parameters

types

string

listener

ComponentEventListener<Sprite>

Returns

this

Inherited from

Component.on


padding()

padding(pad): Sprite

Set cell spacing for layout.

Parameters

pad

number

Returns

Sprite

Inherited from

Component.padding


parent()

parent(): Component

Returns

Component

Inherited from

Component.parent


pin()

Call Signature

pin(key): any

Parameters
key

keyof GetPinType

Returns

any

Inherited from

Component.pin

Call Signature

pin(key, value): this

Parameters
key

keyof SetPinType

value

any

Returns

this

Inherited from

Component.pin

Call Signature

pin(obj): this

Parameters
obj

SetPinType

Returns

this

Inherited from

Component.pin

Call Signature

pin(): Pin

Returns

Pin

Inherited from

Component.pin


prepend()

Call Signature

prepend(...child): this

Parameters
child

...Component[]

Returns

this

Inherited from

Component.prepend

Call Signature

prepend(child): this

Parameters
child

Component[]

Returns

this

Inherited from

Component.prepend


prependTo()

prependTo(parent): Sprite

Parameters

parent

Component

Returns

Sprite

Inherited from

Component.prependTo


prev()

prev(visible?): Component

Parameters

visible?

boolean

Returns

Component

Inherited from

Component.prev


publish()

publish(name, args?): number

Parameters

name

string

args?

any[]

Returns

number

Inherited from

Component.publish


remove()

remove(child?, more?): Sprite

Parameters

child?

Component

more?

any

Returns

Sprite

Inherited from

Component.remove


renderDebug()

renderDebug(ctx, xf): void

Parameters

ctx

CanvasRenderingContext2D

xf

Matrix

Returns

void

Inherited from

Component.renderDebug


rotate()

rotate(a): Sprite

Parameters

a

number

Returns

Sprite

Inherited from

Component.rotate


row()

row(align): Sprite

Parameters

align

number

Returns

Sprite

Inherited from

Component.row


scale()

Call Signature

scale(value): this

Parameters
value

Vec2Value

Returns

this

Inherited from

Component.scale

Call Signature

scale(x, y): this

Parameters
x

number

y

number

Returns

this

Inherited from

Component.scale

Call Signature

scale(s): this

Parameters
s

number

Returns

this

Inherited from

Component.scale


setTimeout()

setTimeout(callback, time): (t) => boolean

Parameters

callback

() => any

time

number

Returns

(t) => boolean

Inherited from

Component.setTimeout


show()

show(): Sprite

Returns

Sprite

Inherited from

Component.show


size()

size(w, h): Sprite

Parameters

w

number

h

number

Returns

Sprite

Inherited from

Component.size


skew()

Call Signature

skew(value): this

Parameters
value

Vec2Value

Returns

this

Inherited from

Component.skew

Call Signature

skew(x, y): this

Parameters
x

number

y

number

Returns

this

Inherited from

Component.skew


spacing()

spacing(space): Sprite

Set cell spacing for row and column layout.

Parameters

space

number

Returns

Sprite

Inherited from

Component.spacing


stretch()

stretch(inner?): Sprite

Parameters

inner?

boolean = false

Returns

Sprite


texture()

texture(frame): Sprite

Parameters

frame

TextureSelectionInput

Returns

Sprite


tick()

tick(callback, before?): void

Parameters

callback

ComponentTickListener<Sprite>

before?

boolean = false

Returns

void

Inherited from

Component.tick


tile()

tile(inner?): Sprite

Parameters

inner?

boolean = false

Returns

Sprite


timeout()

timeout(callback, time): void

Parameters

callback

() => any

time

number

Returns

void

Inherited from

Component.timeout


toString()

toString(): string

Returns

string

Inherited from

Component.toString


touch()

touch(): Sprite

Returns

Sprite

Inherited from

Component.touch


tween()

Call Signature

tween(opts?): Transition

Parameters
opts?

TransitionOptions

Returns

Transition

Inherited from

Component.tween

Call Signature

tween(duration?, delay?, append?): Transition

Parameters
duration?

number

delay?

number

append?

boolean

Returns

Transition

Inherited from

Component.tween


untick()

untick(callback): void

Parameters

callback

ComponentTickListener<Sprite>

Returns

void

Inherited from

Component.untick


visible()

Call Signature

visible(visible): this

Parameters
visible

boolean

Returns

this

Inherited from

Component.visible

Call Signature

visible(): boolean

Returns

boolean

Inherited from

Component.visible


visit()

visit<P>(visitor, payload?): boolean | void

Type Parameters

P

P

Parameters

visitor

ComponentVisitor<P>

payload?

P

Returns

boolean | void

Inherited from

Component.visit


width()

Call Signature

width(w): this

Parameters
w

number

Returns

this

Inherited from

Component.width

Call Signature

width(): number

Returns

number

Inherited from

Component.width