Package com.simsilica.lemur.component
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 Summary
ConstructorsConstructorDescriptionQuadBackgroundComponent
(ColorRGBA color) QuadBackgroundComponent
(ColorRGBA color, float xMargin, float yMargin) QuadBackgroundComponent
(ColorRGBA color, float xMargin, float yMargin, float zOffset, boolean lit) QuadBackgroundComponent
(Texture texture) QuadBackgroundComponent
(Texture texture, float xMargin, float yMargin) QuadBackgroundComponent
(Texture texture, float xMargin, float yMargin, float zOffset, boolean lit) -
Method Summary
Modifier and TypeMethodDescriptionvoid
attach
(GuiControl parent) void
clone()
protected void
void
detach
(GuiControl parent) float
getAlpha()
Returns the current alpha multiplier that is applied to the color when set to the actual visuals.float
getColor()
Returns the current color of this component.float
protected void
refreshBackground
(Vector3f size) protected void
void
void
setAlpha
(float f) Sets an alpha multiplier that will be applied to the color when set to the actual visuals.void
setAlphaDiscard
(float alphaDiscard) Sets the alphaDiscardThreshold for the image material.void
Sets the color for this component.void
setMargin
(float x, float y) void
void
void
void
setZOffset
(float z) Methods inherited from class com.simsilica.lemur.component.AbstractGuiComponent
getGuiControl, getNode, invalidate, isAttached
-
Constructor Details
-
QuadBackgroundComponent
public QuadBackgroundComponent() -
QuadBackgroundComponent
-
QuadBackgroundComponent
-
QuadBackgroundComponent
public QuadBackgroundComponent(ColorRGBA color, float xMargin, float yMargin, float zOffset, boolean lit) -
QuadBackgroundComponent
-
QuadBackgroundComponent
-
QuadBackgroundComponent
public QuadBackgroundComponent(Texture texture, float xMargin, float yMargin, float zOffset, boolean lit)
-
-
Method Details
-
clone
- Specified by:
clone
in interfaceGuiComponent
- Overrides:
clone
in classAbstractGuiComponent
-
attach
- Specified by:
attach
in interfaceGuiComponent
- Overrides:
attach
in classAbstractGuiComponent
-
detach
- Specified by:
detach
in interfaceGuiComponent
- Overrides:
detach
in classAbstractGuiComponent
-
setColor
Description copied from interface:ColoredComponent
Sets the color for this component.- Specified by:
setColor
in interfaceColoredComponent
-
resetColor
protected void resetColor() -
getColor
Description copied from interface:ColoredComponent
Returns the current color of this component.- Specified by:
getColor
in interfaceColoredComponent
-
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 interfaceColoredComponent
-
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 interfaceColoredComponent
-
setTexture
-
getTexture
-
setTextureCoordinateScale
-
getTextureCoordinateScale
-
setMargin
public void setMargin(float x, float y) -
setMargin
-
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
-
calculatePreferredSize
- Specified by:
calculatePreferredSize
in interfaceGuiComponent
-
reshape
- Specified by:
reshape
in interfaceGuiComponent
-
createMaterial
protected void createMaterial() -
refreshBackground
-