Gets the id of the pc-asset of the sprite whose frames the clip plays.
The sprite asset id.
Sets the id of the pc-asset of the sprite whose frames the clip plays.
The sprite asset id.
The nearest ancestor <pc-app> element, or null if this element has no <pc-app>
ancestor. The search starts at the parent, so an element never resolves to itself.
The closest app element, or null.
The nearest ancestor element that fronts an entity — <pc-entity>, <pc-model> or
<pc-node> — or null if this element has no such ancestor. The search starts at the
parent, so an element never resolves to itself.
The closest entity-fronting element, or null.
Gets the rate the clip plays at, in frames per second, where a negative rate plays a looping clip backwards and ends one that does not loop at once.
The frames per second.
Sets the rate the clip plays at, in frames per second, where a negative rate plays a looping clip backwards. A clip starts on its first frame whichever way it plays, so a looping clip at a negative rate wraps round to its last frame and counts down from there, while one that does not loop ends at once. Defaults to 0, which holds the first frame.
The frames per second.
Gets whether the clip loops.
Whether the clip loops.
Sets whether the clip loops. A clip that does not loop stops on its last frame. Defaults
to false.
Whether the clip loops.
Gets the name of the clip, which the parent <pc-sprite>'s clip attribute selects it by.
The clip name.
Sets the name of the clip, which the parent <pc-sprite>'s clip attribute selects it by.
Names must be unique within a <pc-sprite>.
The clip name.
Gets the engine clip this element declares. null until the element is ready, and while
its name is missing or taken by an earlier clip.
The sprite animation clip, or null.
Protected_Called when the element is fully initialized and ready. Subclasses should call this when
they're ready. Resolves the ready promise and dispatches a bubbling, composed ready
event. Signals at most once per readiness cycle: a repeat call before _resetReady
has re-armed the promise does nothing.
Protected_Returns the ready promise to its pending state. Subclasses should call this when the
resource their readiness announced is torn down (typically from disconnectedCallback),
so that a later re-initialization can signal readiness again. Does nothing while the
promise is still pending — an in-flight waiter carries over to the next readiness cycle
rather than being stranded on a promise nothing will ever resolve.
Returns a promise that resolves with this element when it's ready. This is the low-level primitive underlying whenReady, which is the recommended way to wait for elements.
Readiness tracks the element's current lifecycle: once a ready element is torn down (for example by removing it from the document), this returns a fresh promise that resolves when the element is next ready. A promise obtained earlier stays resolved — call this again after re-inserting an element rather than reusing a promise from before its removal.
A promise that resolves with this element when it's ready.
The SpriteClipElement interface provides properties and methods for manipulating
<pc-sprite-clip>elements. The SpriteClipElement interface also inherits the properties and methods of the AsyncElement interface.A clip declares one named animation on its parent
<pc-sprite>: the frames of its spriteasset, played in frame-key order atfpsframes per second. Names must be unique within a<pc-sprite>. The element becomes ready once its clip is added to the sprite component, which loads the sprite asset itself.