Package bagel

Class DrawOptions

java.lang.Object
bagel.DrawOptions

public class DrawOptions extends Object
Allows you to specify detailed options for drawing images. Used with Image.draw(double, double, DrawOptions).
  • Constructor Details

    • DrawOptions

      public DrawOptions()
  • Method Details

    • setScale

      public DrawOptions setScale(double xscale, double yscale)
      Set the scale of the image. A value of 1.0 results in no stretching.
    • setRotation

      public DrawOptions setRotation(double rotation)
      Set the rotation of the image in the usual mathematical sense, measured in radians.
    • setBlendColour

      public DrawOptions setBlendColour(double r, double g, double b)
      Sets the colour to blend the image with, where (0.0, 0.0, 0.0) is black and (1.0, 1.0, 1.0) is white.
    • setBlendColour

      public DrawOptions setBlendColour(double r, double g, double b, double a)
      Sets the colour to blend the image with, where (0.0, 0.0, 0.0) is black and (1.0, 1.0, 1.0) is white.
      Parameters:
      a - the alpha (transparency ratio) to use
    • setBlendColour

      public DrawOptions setBlendColour(Colour colour)
      Sets the colour to blend the image with, using the Colour class.
    • setSection

      public DrawOptions setSection(double xBegin, double yBegin, double width, double height)
      Sets only a section of the image to be drawn. The subimage will be drawn from (xBegin, yBegin) to (xBegin + width, yBegin + height);
    • setShader

      public DrawOptions setShader(Shader shader)
      For very advanced users only. Set the shader to use for this rendering job. Setting up uniforms is your problem.