public class Sprite
extends com.badlogic.gdx.scenes.scene2d.Actor
Modifier and Type | Field and Description |
---|---|
boolean |
started |
Constructor and Description |
---|
Sprite(float x,
float y,
com.badlogic.gdx.graphics.Texture texture)
Creates a Sprite which can be drawn to a stage
|
Modifier and Type | Method and Description |
---|---|
void |
act(float delta)
Can be overridden as an anonymous class to be used like a thread
|
void |
draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float alpha)
Draws a texture at specific coordinates:
|
com.badlogic.gdx.math.Vector2 |
getPosition() |
com.badlogic.gdx.graphics.Texture |
getTexture() |
float |
getX() |
float |
getY() |
void |
increaseX(float amount) |
void |
increaseY(float amount) |
void |
refreshBounds()
Sets the touchable region for clicking on a Sprite to it's position
|
void |
setPosition(float x,
float y) |
void |
setTexture(com.badlogic.gdx.graphics.Texture t) |
void |
setX(float actorX) |
void |
setY(float actorY) |
addAction, addCaptureListener, addListener, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, fire, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getY, getZIndex, hasParent, hit, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
public Sprite(float x, float y, com.badlogic.gdx.graphics.Texture texture)
x
- xPosition on screeny
- yPosition on screentexture
- The image texture usedpublic com.badlogic.gdx.graphics.Texture getTexture()
public void setTexture(com.badlogic.gdx.graphics.Texture t)
t
- the new texture for the spritepublic void act(float delta)
act
in class com.badlogic.gdx.scenes.scene2d.Actor
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float alpha)
draw
in class com.badlogic.gdx.scenes.scene2d.Actor
public void refreshBounds()
public float getX()
getX
in class com.badlogic.gdx.scenes.scene2d.Actor
public void setX(float actorX)
setX
in class com.badlogic.gdx.scenes.scene2d.Actor
public float getY()
getY
in class com.badlogic.gdx.scenes.scene2d.Actor
public void setY(float actorY)
setY
in class com.badlogic.gdx.scenes.scene2d.Actor
public void increaseY(float amount)
public void increaseX(float amount)
public com.badlogic.gdx.math.Vector2 getPosition()
public void setPosition(float x, float y)
setPosition
in class com.badlogic.gdx.scenes.scene2d.Actor