Interface: SpriteStudioSpriteProps
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:11
Everything about which animation and how it plays — as opposed to where it is drawn, which is SsPlacement.
Shared by <SpriteStudioView> and <SpriteStudioSprite> so the two cannot drift on what playing or animation mean. The split matches the components: a view fits one animation to itself, a sprite sits at a point in a scene, and everything else about them is identical.
Extends
Properties
align?
optionalalign?:SsAlign
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:28
animation?
optionalanimation?:string
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:34
Which animation in the pack. Omitted, the pack's first one plays.
Inherited from
fit?
optionalfit?:SsFit
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:57
How the content box is scaled to the view. Default 'contain'.
Inherited from
flipX?
optionalflipX?:boolean
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:29
flipY?
optionalflipY?:boolean
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:30
frame?
optionalframe?:SsBox
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:59
The content box, in player-local units. Omitted, the animation's authored canvas.
Inherited from
frameScope?
optionalframeScope?:SsFrameScope
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:64
Measure the box instead of using the authored canvas — over this animation or the whole pack. Omitted, nothing is measured.
Inherited from
height?
optionalheight?:number
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:27
loop?
optionalloop?:number
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:54
How many times to play. Default 0, which is forever.
Inherited from
measureFrames?
optionalmeasureFrames?:number
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:66
Caps the measuring walk. Default 0, which is one authored cycle.
Inherited from
onAnimationChanged?
optionalonAnimationChanged?: (animation) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:105
A different animation was mounted. Not fired for a restart of the same one.
Parameters
animation
string
Returns
void
Inherited from
SsPlayerProps.onAnimationChanged
onAnimationFinished?
optionalonAnimationFinished?: (animation) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:99
The animation reached its end. Carries which one, since a player outlives them.
Parameters
animation
string
Returns
void
Inherited from
SsPlayerProps.onAnimationFinished
onAnimationLooped?
optionalonAnimationLooped?: (animation) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:101
The playhead crossed a loop boundary.
Parameters
animation
string
Returns
void
Inherited from
SsPlayerProps.onAnimationLooped
onAnimationStarted?
optionalonAnimationStarted?: (animation) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:103
Playback started from the beginning — not on resume.
Parameters
animation
string
Returns
void
Inherited from
SsPlayerProps.onAnimationStarted
onAudio?
optionalonAudio?: (event) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:83
Fires once per authored audio key the playhead crosses.
The event says what to play and where the file is — playing it is the app's job, since this package brings no audio stack of its own.
Parameters
event
Returns
void
Inherited from
onError?
optionalonError?: (error) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:97
Without one, the error goes to console.error rather than nowhere.
Parameters
error
unknown
Returns
void
Inherited from
onLoad?
optionalonLoad?: (player) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:95
The pack loaded and its animation is set up. Hands over the player, so reading getAnimationNames() needs neither the ref nor an effect.
Parameters
player
Returns
void
Inherited from
onSignal?
optionalonSignal?: (event) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:89
Fires once per active signal the playhead crosses — a named command and its parameters, for the app to dispatch. Signals switched off in the timeline are not reported.
Parameters
event
Returns
void
Inherited from
onUserData?
optionalonUserData?: (event) =>void
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:76
Fires once per authored user-data key the playhead crosses.
Parameters
event
Returns
void
Inherited from
parts?
optionalparts?:Readonly<Record<string,SsPartOverride>>
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:74
Per-part overrides on top of the animation, keyed by part name.
Declarative: a part dropped from the map goes back to the animation, so the prop describes the state rather than a history of calls.
Inherited from
playing?
optionalplaying?:boolean
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:50
Default true. false leaves it on its first frame.
Inherited from
scale?
optionalscale?:number
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:32
Multiplier on top of the fit's scale, or the whole scale with no fit.
source
source:
SsSource
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:30
The .ssab to play: a bundled asset, a file path or an http(s) URL.
Inherited from
speed?
optionalspeed?:number
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:52
Multiplier on the authored frame rate. Default 1.
Inherited from
textures?
optionaltextures?:SsTextureSources
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:32
Atlases supplied by the caller. A pack's own are loaded either way.
Inherited from
transitionMs?
optionaltransitionMs?:number
Defined in: packages/react-native-spritestudio/src/view/useSpriteStudioPlayer.ts:48
Milliseconds to crossfade over when animation changes. Default 0, which switches outright — re-posing and heading out, as setAnimation does. Above 0 the change is a crossfade on track 0 instead: the outgoing animation fades while the incoming one plays from its head, and the other tracks stay. The first animation of a load is always set up outright.
With this prop in use, switch track 0 through animation rather than through the player's crossfade(0, …) / setTrackAnimation(0, …) / setAnimation: the prop only acts when it changes, so a clip reached behind its back is one the prop cannot then return from. The tracks above 0 are the player's alone.
Inherited from
width?
optionalwidth?:number
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:26
The box to fit the art into, in scene pixels. Omit both for no fit at all, which is what scale alone wants.
x?
optionalx?:number
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:20
Where the art goes, in scene pixels from the scene's top-left.
Which point of the art lands there depends on the rest: with a width and height it is the box those describe, positioned by align; without them there is no box to fit, so it is the animation's own origin — wherever the author put it.
y?
optionaly?:number
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:21
z?
optionalz?:number
Defined in: packages/react-native-spritestudio/src/view/SpriteStudioSprite.tsx:34
Draw order within the scene; ties break on mount order.