Package tripleplay.ui

Class CapturedRoot

All Implemented Interfaces:
AutoCloseable, Iterable<Element<?>>, react.Closeable

public class CapturedRoot extends Root
A root that renders everything into a single texture. Takes care of hooking into the layout system and updating the image size appropriately. This trades off real-time rendering performance (which is much improved because the entire UI is one texture), with memory use (a backing texture is needed for the whole UI) and the expense of re-rendering the entire UI whenever anything changes.
  • Constructor Details

    • CapturedRoot

      public CapturedRoot(Interface iface, Layout layout, Stylesheet sheet, QuadBatch defaultBatch)
      Creates a new captured root with the given values.
      Parameters:
      defaultBatch - the quad batch to use when capturing the UI scene graph. This is usually your game's default quad batch.
  • Method Details

    • texture

      public react.ValueView<Texture> texture()
      Gets the texture into which the root is rendered. This may be null if no validation has yet occurred and may change value when the root's size changes.
    • createWidget

      public Element<?> createWidget()
      Creates a widget that will display this root in an image layer. The computed size of the returned widget will be the size of this root, but the widget's layout will not affect the root.
    • setSize

      public Root setSize(float width, float height)
      Description copied from class: Root
      Sets the size of this root element.
      Overrides:
      setSize in class Root
    • layout

      public void layout()