DrawSpriteOpt
: RenderProps & {sprite
: string | SpriteData | Asset<SpriteData>The sprite name in the asset manager, or the raw sprite data.
frame
?: numberIf the sprite is loaded with multiple frames, or sliced, use the frame option to specify which frame to draw.
width
?: numberWidth of sprite. If height
is not specified it'll stretch with aspect ratio. If tiled
is set to true it'll tiled to the specified width horizontally.
height
?: numberHeight of sprite. If width
is not specified it'll stretch with aspect ratio. If tiled
is set to true it'll tiled to the specified width vertically.
tiled
?: booleanWhen set to true, width
and height
will not scale the sprite but instead render multiple tiled copies of them until the specified width and height. Useful for background texture pattern etc.
flipX
?: booleanIf flip the texture horizontally.
flipY
?: booleanIf flip the texture vertically.
quad
?: QuadThe sub-area to render from the texture, by default it'll render the whole quad(0, 0, 1, 1)
anchor
?: Anchor | Vec2The anchor point, or the pivot point. Default to "topleft".
pos
?: Vec2The position
How the sprite should look like.