public class SimpleAnim extends GameObject
Constructor and Description |
---|
SimpleAnim(java.io.InputStream is,
java.lang.String ref,
boolean flipped,
int frameWidth,
int frameHeight,
int nOfFrames,
org.newdawn.slick.GameContainer gc)
SimpleAnimObject constructor(without info window)
|
SimpleAnim(java.io.InputStream is,
java.lang.String ref,
boolean flipped,
int frameWidth,
int frameHeight,
int nOfFrames,
java.lang.String info,
org.newdawn.slick.GameContainer gc)
SimpleAnimObject constructor(with info window)
|
Modifier and Type | Method and Description |
---|---|
void |
draw(float reqSize,
boolean scaledPos) |
void |
draw(float x,
float y,
float scale,
boolean scaledPos)
Draws object on specified position on screen
|
boolean |
isLastFrame()
Checks if current animation frame is last frame
|
boolean |
isMouseOver() |
draw, draw, draw, getDis, getPosition, getScale, getScaledHeight, getScaledWidth, setPosition
bind, clampTexture, copy, destroy, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, drawCentered, drawEmbedded, drawEmbedded, drawEmbedded, drawFlash, drawFlash, drawFlash, drawSheared, drawSheared, drawWarped, endUse, ensureInverted, flushPixelData, getAlpha, getCenterOfRotationX, getCenterOfRotationY, getColor, getFilter, getFlippedCopy, getGraphics, getHeight, getName, getResourceReference, getRotation, getScaledCopy, getScaledCopy, getSubImage, getTexture, getTextureHeight, getTextureOffsetX, getTextureOffsetY, getTextureWidth, getWidth, isDestroyed, rotate, setAlpha, setCenterOfRotation, setColor, setColor, setFilter, setImageColor, setImageColor, setName, setRotation, setTexture, startUse, toString
public SimpleAnim(java.io.InputStream is, java.lang.String ref, boolean flipped, int frameWidth, int frameHeight, int nOfFrames, java.lang.String info, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
is
- InputStream to sprite sheet fileref
- Name for sprite sheetflipped
- If sprite sheet should be flippedframeWith
- Width of single frame on sprite sheetframeHeight
- Height of single frame on sprite sheetnOfFrames
- Number of frame in sprite sheet(max 5)info
- Strin with info for info windoworg.newdawn.slick.SlickException
java.awt.FontFormatException
java.io.IOException
public SimpleAnim(java.io.InputStream is, java.lang.String ref, boolean flipped, int frameWidth, int frameHeight, int nOfFrames, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException
is
- InputStream to sprite sheet fileref
- Name for sprite sheetflipped
- If sprite sheet should be flippedframeWith
- Width of single frame on sprite sheetframeHeight
- Height of single frame on sprite sheetnOfFrames
- Number of frame in sprite sheet(max 5)org.newdawn.slick.SlickException
java.awt.FontFormatException
java.io.IOException
public void draw(float x, float y, float scale, boolean scaledPos)
GameObject
draw
in class GameObject
x
- Position on x-axisy
- Position on y-axisscale
- Defines size of object(remember that object is always implicitly scaled to current resolution)scaledPos
- True if position should be scale to current resolution, false otherwise(Irrespective to this, object size is still scaled)public void draw(float reqSize, boolean scaledPos)
draw
in class GameObject
public boolean isMouseOver()
isMouseOver
in class GameObject
public boolean isLastFrame()