Class QuadBackgroundComponent

java.lang.Object
com.simsilica.lemur.component.AbstractGuiComponent
com.simsilica.lemur.component.QuadBackgroundComponent
All Implemented Interfaces:
ColoredComponent, GuiComponent, Cloneable
Direct Known Subclasses:
NAspectPreservingQuadBackground

public class QuadBackgroundComponent extends AbstractGuiComponent implements Cloneable, ColoredComponent
  • Constructor Details

    • QuadBackgroundComponent

      public QuadBackgroundComponent()
    • QuadBackgroundComponent

      public QuadBackgroundComponent(ColorRGBA color)
    • QuadBackgroundComponent

      public QuadBackgroundComponent(ColorRGBA color, float xMargin, float yMargin)
    • QuadBackgroundComponent

      public QuadBackgroundComponent(ColorRGBA color, float xMargin, float yMargin, float zOffset, boolean lit)
    • QuadBackgroundComponent

      public QuadBackgroundComponent(Texture texture)
    • QuadBackgroundComponent

      public QuadBackgroundComponent(Texture texture, float xMargin, float yMargin)
    • QuadBackgroundComponent

      public QuadBackgroundComponent(Texture texture, float xMargin, float yMargin, float zOffset, boolean lit)
  • Method Details

    • clone

      public QuadBackgroundComponent clone()
      Specified by:
      clone in interface GuiComponent
      Overrides:
      clone in class AbstractGuiComponent
    • attach

      public void attach(GuiControl parent)
      Specified by:
      attach in interface GuiComponent
      Overrides:
      attach in class AbstractGuiComponent
    • detach

      public void detach(GuiControl parent)
      Specified by:
      detach in interface GuiComponent
      Overrides:
      detach in class AbstractGuiComponent
    • setColor

      public void setColor(ColorRGBA c)
      Description copied from interface: ColoredComponent
      Sets the color for this component.
      Specified by:
      setColor in interface ColoredComponent
    • resetColor

      protected void resetColor()
    • getColor

      public ColorRGBA getColor()
      Description copied from interface: ColoredComponent
      Returns the current color of this component.
      Specified by:
      getColor in interface ColoredComponent
    • setAlpha

      public void setAlpha(float f)
      Description copied from interface: ColoredComponent
      Sets an alpha multiplier that will be applied to the color when set to the actual visuals.
      Specified by:
      setAlpha in interface ColoredComponent
    • getAlpha

      public float getAlpha()
      Description copied from interface: ColoredComponent
      Returns the current alpha multiplier that is applied to the color when set to the actual visuals.
      Specified by:
      getAlpha in interface ColoredComponent
    • setTexture

      public void setTexture(Texture t)
    • getTexture

      public Texture getTexture()
    • setTextureCoordinateScale

      public void setTextureCoordinateScale(Vector2f scale)
    • getTextureCoordinateScale

      public Vector2f getTextureCoordinateScale()
    • setMargin

      public void setMargin(float x, float y)
    • setMargin

      public void setMargin(Vector2f margin)
    • getMargin

      public Vector2f getMargin()
    • setZOffset

      public void setZOffset(float z)
    • getZOffset

      public float getZOffset()
    • setAlphaDiscard

      public void setAlphaDiscard(float alphaDiscard)
      Sets the alphaDiscardThreshold for the image material. If an alpha value is below this threshold then it will be discarded rather than being written to the color and zbuffers. Set to 0 to disable. Defaults to 0.

      Note: for 2D UIs this threshold is not necessary as 2D GUIs will always sort purely back-to-front on Z. For 3D UIs, this setting may prevent visual artifacts from certain directions for very transparent pixels (background showing through, etc.))

    • getAlphaDiscard

      public float getAlphaDiscard()
    • getMaterial

      public GuiMaterial getMaterial()
    • calculatePreferredSize

      public void calculatePreferredSize(Vector3f size)
      Specified by:
      calculatePreferredSize in interface GuiComponent
    • reshape

      public void reshape(Vector3f pos, Vector3f size)
      Specified by:
      reshape in interface GuiComponent
    • createMaterial

      protected void createMaterial()
    • refreshBackground

      protected void refreshBackground(Vector3f size)