Class Texture

java.lang.Object
rosequartz.gfx.Texture

public class Texture extends Object
Represents a texture.
  • Constructor Details

  • Method Details

    • setMinificationFunction

      public Texture setMinificationFunction(Texture.ResizeFunction function) throws NotOnGraphicsThreadException
      Sets the function used for minification of the texture. The default is ResizeFilter.NEAREST.
      Parameters:
      function - function used for minification
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • setMagnificationFunction

      public Texture setMagnificationFunction(Texture.ResizeFunction function) throws NotOnGraphicsThreadException
      Sets the function used for magnification of the texture. The default is ResizeFilter.NEAREST.
      Parameters:
      function - function used for magnification
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • setResizeFunctions

      public Texture setResizeFunctions(Texture.ResizeFunction function) throws NotOnGraphicsThreadException
      Sets the functions used for minification and magnification of the texture.
      Parameters:
      function - function used for minification and magnification
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • blit

      public Texture blit(float srcX1, float srcY1, float srcX2, float srcY2, float destX1, float destY1, float destX2, float destY2) throws NotOnGraphicsThreadException
      Blits this texture onto the current render target.
      Parameters:
      srcX1 - position of the bottom left corner of the area to blit from on the x-axis
      srcY1 - position of the bottom left corner of the area to blit from on the y-axis
      srcX2 - position of the top right corner of the area to blit from on the x-axis
      srcY2 - position of the top right corner of the area to blit from on the y-axis
      destX1 - position of the bottom left corner of the area to blit to on the x-axis
      destY1 - position of the bottom left corner of the area to blit to on the y-axis
      destX2 - position of the top right corner of the area to blit to on the x-axis
      destY2 - position of the top right corner of the area to blit to on the y-axis
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • blit

      public Texture blit(Vec2 src1, Vec2 src2, Vec2 dest1, Vec2 dest2) throws NotOnGraphicsThreadException
      Blits this texture onto the current render target.
      Parameters:
      src1 - position of the bottom left corner of the area to blit from
      src2 - position of the top right corner of the area to blit from
      dest1 - position of the bottom left corner of the area to blit to
      dest2 - position of the top right corner of the area to blit to
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • getWidth

      public int getWidth()
      Gets the width of the texture.
      Returns:
      texture width
    • getHeight

      public int getHeight()
      Gets the height of the texture.
      Returns:
      texture height
    • _getNativeTexture

      public NativesFX.Texture _getNativeTexture()
    • toString

      public String toString()
      Overrides:
      toString in class Object