Class ImageBackdrop


public class ImageBackdrop extends SolidBackdrop
This backdrop paints a single image on a colored plane behind the component, stretching it and aligning it to the component based on given settings.
  • Field Details

    • _image

      protected SubTex _image
      The image to draw.
    • _axis

      protected ImageBackdrop.StretchAxis _axis
      The axis to stretch the image on.
    • _alignment

      protected Alignment _alignment
      The alignment (to the component) to align the image to.
    • _dims

      protected final double[] _dims
      used internally to hold component measurements prior to drawing backdrop
  • Constructor Details

    • ImageBackdrop

      public ImageBackdrop(SubTex image)
      Construct this back drop, using the given image.
      Parameters:
      image - the image
    • ImageBackdrop

      public ImageBackdrop(SubTex image, ReadOnlyColorRGBA color)
      Construct this back drop, using the given image and color.
      Parameters:
      image - the image to draw
      color - the color of the backdrop
  • Method Details

    • draw

      public void draw(Renderer renderer, UIComponent comp)
      Description copied from class: UIBackdrop
      Draw this backdrop. Override this method to do the actual work.
      Overrides:
      draw in class SolidBackdrop
      Parameters:
      renderer - the renderer to use in drawing.
      comp - the component we are drawing the background for.
    • getDimensions

      public void getDimensions(UIComponent comp, double[] vals)
    • getImage

      public SubTex getImage()
    • setImage

      public void setImage(SubTex image)
    • getStretch

      public ImageBackdrop.StretchAxis getStretch()
    • setStretch

      public void setStretch(ImageBackdrop.StretchAxis axis)
    • getAlignment

      public Alignment getAlignment()
    • setAlignment

      public void setAlignment(Alignment alignment)
    • getTintColor

      public ReadOnlyColorRGBA getTintColor()
    • setTintColor

      public void setTintColor(ReadOnlyColorRGBA color)
      Sets a color to use for tinting the backdrop.
      Parameters:
      color - the color to set