Package com.xebisco.yield.texture
Class Texture
java.lang.Object
com.xebisco.yield.FileInput
com.xebisco.yield.AbstractTexture
com.xebisco.yield.texture.Texture
- All Implemented Interfaces:
AutoCloseable
The
Texture class represents an image texture and provides methods for processing and manipulating it.-
Constructor Summary
ConstructorsConstructorDescriptionTexture(Object imageRef, Vector2D size, String path, TextureFilter filter, TextureManager textureManager, FileIOManager ioManager) Constructs a newTextureobject from an image reference and size.Texture(String path, TextureFilter filter, TextureManager textureManager, FileIOManager ioManager) Constructs a newTextureobject from a file path and texture filter. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the texture and releases any associated resources.static String[]Returns an array of string extensions that are supported by theTextureclass.Returns theFileIOManagerinstance that is responsible for handling file I/O operations.size()Returns the size of the spritesheet texture.Returns theTextureManagerresponsible for loading and unloading textures.Methods inherited from class com.xebisco.yield.AbstractTexture
filter, imageRef, setImageRefMethods inherited from class com.xebisco.yield.FileInput
fileFormat, path
-
Constructor Details
-
Texture
public Texture(String path, TextureFilter filter, TextureManager textureManager, FileIOManager ioManager) throws IOException Constructs a newTextureobject from a file path and texture filter.- Parameters:
path- The path to the image file.filter- The texture filter to apply.textureManager- The texture manager to use for loading and unloading textures.- Throws:
IOException- If an error occurs while loading the texture from the file.
-
Texture
public Texture(Object imageRef, Vector2D size, String path, TextureFilter filter, TextureManager textureManager, FileIOManager ioManager) Constructs a newTextureobject from an image reference and size.- Parameters:
imageRef- The image reference to use for the texture.size- The size of the texture.path- The path to the image file (ignored if an image reference is provided).filter- The texture filter to apply.textureManager- The texture manager to use for loading and unloading textures.
-
-
Method Details
-
extensions
Returns an array of string extensions that are supported by theTextureclass.- Returns:
- an array of string extensions.
-
close
public void close()Description copied from class:AbstractTextureCloses the texture and releases any associated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classAbstractTexture
-
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 theFileIOManagerinstance that is responsible for handling file I/O operations.- Returns:
- the
FileIOManagerinstance.
-