Class TbtQuadBackgroundComponent

java.lang.Object
com.simsilica.lemur.component.AbstractGuiComponent
com.simsilica.lemur.component.TbtQuadBackgroundComponent
All Implemented Interfaces:
ColoredComponent, GuiComponent, Cloneable

public class TbtQuadBackgroundComponent extends AbstractGuiComponent implements Cloneable, ColoredComponent
A texture-covered background quad.

The texture is split up into a three-by-three grid in this fashion:

    +---+--------------+-------+
    |   |    <----->   |       |
 y2 +---+--------------+-------+
    |   |              |       |
    | ^ |       ^      |   ^   |
    | | |       |      |   |   |
    | | |    <----->   |   |   |
    | | |       |      |   |   |
    | v |       v      |   v   |
    |   |              |       |
 y1 +---+--------------+-------+
    |   |    <----->   |       |
    +---+--------------+-------+
       x1             x2
 
Arrows indicate the direction in which each grid cell will stretch to fill the area given by the component.
All coordinates are relative to the lower-left border.

Common pitfalls

  • Placing controls on a fractional coordinate. This usually happens when centering controls.
  • Having a contrast at the border between stretched and unstretched texture zone (e.g. a black border and a white center). Stretching involves interpolating colors with the neighbouring pixels (i.e. you'll get a black-to-white color gradient).
    The easiest workaround is to make the border one pixel wider so that the contrast will be safely inside the unstretched area.
  • Using a texture that is larger than the quad.