Package io.github.team6ENG.EscapeUni
Class SpriteAnimations
java.lang.Object
io.github.team6ENG.EscapeUni.SpriteAnimations
Cuts sprite sheets up into animations
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpriteAnimations(String file, int SheetCols, int SheetRows) Loads sprite sheet -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()protected voidgenerateAnimation(HashMap<String, Integer[]> animInfo, float animationSpeed) Cuts the sprite sheet up Stores resulting animations into animations dictionaryvoidloadSprite(com.badlogic.gdx.maps.tiled.TiledMapTileLayer walls, int id, int d) Stores map info for later boundary detection
-
Field Details
-
animations
-
x
public float x -
y
public float y -
wallsLayer
protected com.badlogic.gdx.maps.tiled.TiledMapTileLayer wallsLayer -
mapWallsId
protected int mapWallsId -
tileDimensions
protected int tileDimensions
-
-
Constructor Details
-
SpriteAnimations
Loads sprite sheet- Parameters:
file- path of sprite sheetSheetCols- Number of columns in sheetSheetRows- Number of rows in sheet
-
-
Method Details
-
loadSprite
public void loadSprite(com.badlogic.gdx.maps.tiled.TiledMapTileLayer walls, int id, int d) Stores map info for later boundary detection- Parameters:
walls- tilemap of game wallsid- tilemap layer which represents the wallsd- dimentions of each tile on the map i.e. 8 or 16
-
generateAnimation
Cuts the sprite sheet up Stores resulting animations into animations dictionary- Parameters:
animInfo- dictionary of sprite sheet layout: key - Name of animation Value - Array representing row of animation on sprite sheet and index of start and end framesanimationSpeed- number of seconds each animation frame should last
-
dispose
public void dispose()
-