Class Texture

All Implemented Interfaces:
AutoCloseable

public class Texture extends AbstractTexture
The Texture class represents an image texture and provides methods for processing and manipulating it.
  • Constructor Details

    • Texture

      public Texture(String path, TextureFilter filter, TextureManager textureManager, FileIOManager ioManager) throws IOException
      Constructs a new Texture object 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 new Texture object 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

      public static String[] extensions()
      Returns an array of string extensions that are supported by the Texture class.
      Returns:
      an array of string extensions.
    • close

      public void close()
      Description copied from class: AbstractTexture
      Closes the texture and releases any associated resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in class AbstractTexture
    • size

      public ImmutableVector2D size()
      Returns the size of the spritesheet texture.
      Returns:
      The size of the spritesheet texture.
    • textureManager

      public TextureManager textureManager()
      Returns the TextureManager responsible for loading and unloading textures.
      Returns:
      The TextureManager.
    • getIoManager

      public FileIOManager getIoManager()
      Returns the FileIOManager instance that is responsible for handling file I/O operations.
      Returns:
      the FileIOManager instance.