Loading...
Loading...
Use this skill when drawing images in PixiJS v8. Covers Sprite with anchor/tint/texture, AnimatedSprite for frame animation, NineSliceSprite for resizable UI panels, TilingSprite for scrolling/repeating backgrounds. Triggers on: Sprite, AnimatedSprite, NineSliceSprite, TilingSprite, Sprite.from, anchor, tint, tilePosition, animationSpeed, gotoAndPlay, leftWidth, topHeight, constructor options, SpriteOptions, AnimatedSpriteOptions, NineSliceSpriteOptions, TilingSpriteOptions.
npx skill4agent add pixijs/pixijs-skills pixijs-scene-spriteSpriteNineSliceSpriteTilingSpriteAnimatedSpriteSpritepixijs-scene-core-conceptsContainerconst texture = await Assets.load("bunny.png");
const sprite = new Sprite({
texture,
anchor: 0.5,
tint: 0xff8888,
});
sprite.x = app.screen.width / 2;
sprite.y = app.screen.height / 2;
app.stage.addChild(sprite);app.screen.width / 2xyContainerpixijs-scene-core-conceptspixijs-assetspixijs-scene-particle-containerpixijs-performance| Variant | Use when | Trade-offs | Reference |
|---|---|---|---|
| Draw a single texture at a position | Fixed size = texture size | references/sprite.md |
| Frame-based animation from a texture array or spritesheet | Pre-rendered frames only; no tweening | references/animated-sprite.md |
| Resizable UI panels, buttons, dialog frames | Border width is fixed; center stretches | references/nineslice-sprite.md |
| Scrolling backgrounds, parallax, repeating patterns | Single texture repeated; | references/tiling-sprite.md |
AnimatedSpriteSpriteSpritereferences/{variant}.mdContainerpositionscaletintlabelfilterszIndexskills/pixijs-scene-core-concepts/references/constructor-options.mdSpriteAnimatedSpritesheet.animations['walk']references/animated-sprite.mdNineSliceSpritewidthheightreferences/nineslice-sprite.mdTilingSpritetilePositionreferences/tiling-sprite.mdParticleContainerParticlepixijs-scene-particle-containerGraphicspixijs-scene-graphicsSprite.anchor[0, 1]Container.pivotanchor.set(0.5)Sprite.from(id)await Assets.load(...)Texturenew Sprite(texture)frametexture.dynamic = truesprite['onViewUpdate']()Texture.from(url)const texture = Texture.from("https://example.com/image.png");const texture = await Assets.load("https://example.com/image.png");Texture.from()Assets.load()sprite.pivot.set(sprite.width / 2, sprite.height / 2);sprite.anchor.set(0.5);anchorpivotNineSlicePlaneNineSlicePlaneNineSliceSpritenew NineSliceSprite({ texture, leftWidth, topHeight, rightWidth, bottomHeight })SpriteNineSliceSpriteTilingSpriteallowChildren = falseContainer