Skip to content
Eloy Villasclaras edited this page Apr 10, 2016 · 2 revisions

<sprite/> renders a Phaser.Sprite in the scene. Sprites can only be created under a <game> or <group> node.

Properties

These properties are set when the component is first mounted, and updated in later renders, if their value changes.

Property Notes
scale Sets or updates point scale. It must have format: {x: [number], y: [number]}.
Alternatively, you can use properties:
  • scaleX: [number]
  • scaleY: [number]
assetKey Sets or updates attribute key
angle Sets or updates attribute angle
autocull Sets or updates attribute autocull
checkWorldBounds Sets or updates attribute checkWorldBounds
outOfBoundsKill Sets or updates attribute outOfBoundsKill
alive Sets or updates attribute alive
lifespan Sets or updates attribute lifespan
frame Sets or updates attribute frame
frameName Sets or updates attribute frameName
x Sets or updates attribute x
y Sets or updates attribute y
body This property is protected, and cannot be set manually. The attributes of body can be manipulated by using the properties below body...
bodyImmovable Sets or updates attribute body.immovable
bodyCollideWorldBounds Sets or updates attribute body.collideWorldBounds
bodyBounce Sets or updates point body.bounce. Must have format: {x: [number], y: [number]}.
Alternatively, you can use properties:
  • bodyBounceX: [number]
  • bodyBounceY: [number]
bodyGravity Sets or updates point body.gravity. Must have format: {x: [number], y: [number]}.
Alternatively, you can use properties:
  • bodyGravityX: [number]
  • bodyGravityY: [number]
bodyPhysics
smoothed Sets or updates attribute smoothed
Clone this wiki locally