pixijs-scene-sprite

安装量: 838
排名: #4738

安装

npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-sprite

PixiJS has three sprite classes for different drawing tasks. Sprite is the default image-drawing leaf; NineSliceSprite is a resizable UI-panel variant that preserves corner art; TilingSprite repeats a texture across an area. The AnimatedSprite subclass of Sprite cycles through texture frames for frame-based animation. Assumes familiarity with pixijs-scene-core-concepts . All sprite classes are leaf nodes; they cannot have children. Wrap multiple sprites in a Container to group them. Quick Start const 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 ) ; Position is set after construction because app.screen.width / 2 depends on the live renderer size. Literal positions can go directly in the options object via x / y (inherited from Container ).

返回排行榜