Package com.xebisco.yield.texture
Class SpritesheetTexture
java.lang.Object
com.xebisco.yield.FileInput
com.xebisco.yield.texture.SpritesheetTexture
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionSpritesheetTexture(String path, TextureManager textureManager, FileIOManager ioManager) Constructs aSpritesheetTexturefrom a given path andTextureManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns theFileIOManagerresponsible for reading and writing files.imageRef()Returns the reference to the image object associated with this texture.setImageRef(Object imageRef) Sets the image reference for this texture.size()Returns the size of the spritesheet texture.Returns theTextureManagerresponsible for loading and unloading textures.Methods inherited from class com.xebisco.yield.FileInput
fileFormat, path
-
Constructor Details
-
SpritesheetTexture
public SpritesheetTexture(String path, TextureManager textureManager, FileIOManager ioManager) throws IOException Constructs aSpritesheetTexturefrom a given path andTextureManager.- Parameters:
path- The path to the spritesheet file.textureManager- TheTextureManagerresponsible for loading and unloading textures.- Throws:
IOException- If an error occurs while reading the spritesheet file.
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
imageRef
Returns the reference to the image object associated with this texture.- Returns:
- The reference to the image object.
-
setImageRef
Sets the image reference for this texture.- Parameters:
imageRef- The reference to the image object.- Returns:
- This instance of
SpritesheetTexturefor method chaining.
-
size
Returns the size of the spritesheet texture.- Returns:
- The size of the spritesheet texture.
-
textureManager
Returns theTextureManagerresponsible for loading and unloading textures.- Returns:
- The
TextureManager.
-
getIoManager
Returns theFileIOManagerresponsible for reading and writing files.- Returns:
- The
FileIOManager.
-