Package tripleplay.ui
Class CapturedRoot
java.lang.Object
- All Implemented Interfaces:
AutoCloseable
,Iterable<Element<?>>
,react.Closeable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.ui.Container
Container.Mutable<T extends Container.Mutable<T>>
Nested classes/interfaces inherited from class tripleplay.ui.Element
Element.Take
Nested classes/interfaces inherited from interface react.Closeable
react.Closeable.Set, react.Closeable.Util
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCapturedRoot
(Interface iface, Layout layout, Stylesheet sheet, QuadBatch defaultBatch) Creates a new captured root with the given values. -
Method Summary
Methods inherited from class tripleplay.ui.Root
close, getMenuHost, isShowing, pack, pack, packToHeight, packToWidth, preferredSize, setAbsorbsClicks, setBounds, setLocation, setMenuHost, setSize, validate
Methods inherited from class tripleplay.ui.Elements
add, add, childAdded, childAt, childCount, childRemoved, destroy, destroyAll, destroyAt, iterator, remove, removeAll, removeAt, setStylesheet, stylesheet
Methods inherited from class tripleplay.ui.Container
removeFromParent
Methods inherited from class tripleplay.ui.Element
addStyles, addStyles, bindEnabled, bindVisible, bounds, constraint, enabledSlot, hierarchyChanged, isAdded, isEnabled, isVisible, location, parent, setConstraint, setEnabled, setStyles, setStyles, setVisible, size, styles, visibleSlot, x, y
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CapturedRoot
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
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
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
Description copied from class:Root
Sets the size of this root element. -
layout
public void layout()
-