Index: com/simsilica/lemur/core/GuiControl.java =================================================================== --- com/simsilica/lemur/core/GuiControl.java (Revision 1005) +++ com/simsilica/lemur/core/GuiControl.java (Arbeitskopie) @@ -49,7 +49,7 @@ implements FocusTarget { private SafeArrayList components = new SafeArrayList(GuiComponent.class); - private GuiComponent layout; + private GuiLayout layout; private volatile boolean invalid = false; private Map index = new HashMap(); private Vector3f preferredSizeOverride = null; Index: com/simsilica/lemur/component/TbtQuadBackgroundComponent.java =================================================================== --- com/simsilica/lemur/component/TbtQuadBackgroundComponent.java (Revision 1005) +++ com/simsilica/lemur/component/TbtQuadBackgroundComponent.java (Arbeitskopie) @@ -47,8 +47,59 @@ /** - * - * @author Paul Speed + * A texture-covered background area for drawing background areas.
+ * The texture will be stretched using a three-by-three raster to cover the + * required size. + *

+ * The defining properties are: + *

    + *
  • the texture itself; + *
  • what parts of the texture are to be mapped to what parts of the raster + * this is done by defining the center rectangle of the raster, in terms of + * texture coordinates; + *
  • an image scale; it does not apply to the center rectangle but everywhere + * else; + *
  • a Z coordinate to define stacking order; + *
  • whether to use lighting (via Lighting.j3md) or not (via Unshaded.j3md). + *
+ * + * The raster rectangle is defined via the x/y coordinates of the bottom left + * and top right corner of the center rectangle that takes up all stretching, + * like this (the directions in which each texture area may stretch is indicated + * via arrows): + * + *
+ *    +---+--------------+-------+
+ *    |   |    <----->   |       |
+ * y2 +---+--------------+-------+
+ *    |   |              |       |
+ *    | ^ |       ^      |   ^   |
+ *    | | |       |      |   |   |
+ *    | | |    <----->   |   |   |
+ *    | | |       |      |   |   |
+ *    | v |       v      |   v   |
+ *    |   |              |       |
+ * y1 +---+--------------+-------+
+ *    |   |    <----->   |       |
+ *    +---+--------------+-------+
+ *       x1             x2
+ * 
+ * + * All x and y coordinates relative to the bottom left corner of the texture. + *

+ * Common pitfalls + *

    + * Placing controls on a fractional coordinate. Something to watch out for 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. + * + * @author Paul Speed */ public class TbtQuadBackgroundComponent extends AbstractGuiComponent implements Cloneable, ColoredComponent