Sprite¶
-
php\gdx\graphics\Sprite
Class Sprite
Methods
__construct
($texture, $width, $height, $x, $y)¶
Parameters:
- $texture – php\gdx\graphics\Texture - (optional)
- $width – int - (optional)
- $height – int - (optional)
- $x – int - (optional)
- $y – int - (optional)
setBounds
($x, $y, $width, $height)¶
Parameters:
- $x – int
- $y – int
- $width – int
- $height – int
setSize
($width, $height)¶
Parameters:
- $width – int
- $height – int
setPosition
($x, $y)¶
Parameters:
- $x – int
- $y – int
setX
($x)¶
Parameters:
- $x – int
getX
()¶
Returns: int
setY
($y)¶
Parameters:
- $y – int
getY
()¶
Returns: int
translateX
($xAmount)¶
Parameters:
- $xAmount – double
translateY
($yAmount)¶
Parameters:
- $yAmount – double
translate
($xAmount, $yAmount)¶
Parameters:
- $xAmount – double
- $yAmount – double
setAlpha
($alpha)¶
Parameters:
- $alpha – double
setOrigin
($originX, $originY)¶
Parameters:
- $originX – int
- $originY – int
setOriginCenter
()¶
setRotation
($degrees)¶
Parameters:
- $degrees – double
getRotation
()¶
Returns: double
rotate
($degrees)¶
Parameters:
- $degrees – double
rotate90
($clockwise)¶
Parameters:
- $clockwise – bool
setScale
($scaleXY, $scaleY)¶
Parameters:
- $scaleXY – double
- $scaleY – double - (optional)
scale
($amount)¶
Parameters:
- $amount – double
flip
($x, $y)¶
Parameters:
- $x – int
- $y – int
scroll
($xAmount, $yAmount)¶
Parameters:
- $xAmount – double
- $yAmount – double
draw
($batch, $alphaModulation)¶
Parameters:
- $batch – php\gdx\graphics\SpriteBatch
- $alphaModulation – double - (optional)