Class OUI
- java.lang.Object
-
- org.lwjgl.nanovg.OUI
-
public class OUI extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intUI_ACTIVEItem states as returned byGetState.static intUI_ANYEnum values:static intUI_BREAKChild layout flags to pass toSetLayout.static intUI_BUTTON0_CAPTURE
UI_BUTTON0_DOWN
UI_BUTTON0_HOT_UP
UI_BUTTON0_UP
UI_BUTTON2_DOWNEvent flags.static intUI_CENTERChild layout flags to pass toSetLayout.static intUI_CHAREvent flags.static intUI_COLDItem states as returned byGetState.static intUI_COLUMNContainer flags to pass toSetBox.static intUI_DOWNChild layout flags to pass toSetLayout.static intUI_ENDContainer flags to pass toSetBox.static intUI_FILLChild layout flags to pass toSetLayout.static intUI_FLEXContainer flags to pass toSetBox.static intUI_FROZENItem states as returned byGetState.static intUI_HCENTER
UI_HFILLChild layout flags to pass toSetLayout.static intUI_HOTItem states as returned byGetState.static intUI_JUSTIFYContainer flags to pass toSetBox.static intUI_KEY_DOWN
UI_KEY_UPEvent flags.static intUI_LAYOUTContainer flags to pass toSetBox.static intUI_LEFTChild layout flags to pass toSetLayout.static intUI_MIDDLE
UI_NOWRAPContainer flags to pass toSetBox.static intUI_RIGHTChild layout flags to pass toSetLayout.static intUI_ROWContainer flags to pass toSetBox.static intUI_SCROLLEvent flags.static intUI_STARTContainer flags to pass toSetBox.static intUI_TOPChild layout flags to pass toSetLayout.static intUI_USERMASKEnum values:static intUI_VCENTER
UI_VFILLChild layout flags to pass toSetLayout.static intUI_WRAPContainer flags to pass toSetBox.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longnuiAllocHandle(int item, int size)Unsafe version of:AllocHandlestatic intnuiContains(int item, int x, int y)Unsafe version of:Containsstatic voidnuiDestroyContext(long ctx)Unsafe version of:DestroyContextstatic intnuiGetButton(int button)Unsafe version of:GetButtonstatic voidnuiGetCursor(long __result)Unsafe version of:GetCursorstatic voidnuiGetCursorDelta(long __result)Unsafe version of:GetCursorDeltastatic voidnuiGetCursorStart(long __result)Unsafe version of:GetCursorStartstatic voidnuiGetCursorStartDelta(long __result)Unsafe version of:GetCursorStartDeltastatic longnuiGetHandler()Unsafe version of:GetHandlerstatic voidnuiGetRect(int item, long __result)Unsafe version of:GetRectstatic voidnuiGetScroll(long __result)Unsafe version of:GetScrollstatic voidnuiSetButton(int button, int mod, int enabled)Unsafe version of:SetButtonstatic voidnuiSetFrozen(int item, int enable)Unsafe version of:SetFrozenstatic voidnuiSetHandler(long handler)Unsafe version of:SetHandlerstatic voidnuiSetKey(int key, int mod, int enabled)Unsafe version of:SetKeystatic voidnuiSetMargins(int item, short l, short t, short r, short b)Unsafe version of:SetMarginsstatic java.nio.ByteBufferuiAllocHandle(int item, int size)Allocates space for application-dependent context data and assign it as the handle to the item.static intuiAppend(int item, int sibling)Assigns an item to the same container as another item.static voiduiBeginLayout()Clears the item buffer.static voiduiClearState()Resets the currently stored hot/active etc.static booleanuiContains(int item, int x, int y)Returns 1 if an items absolute rectangle contains a given coordinate, otherwise 0.static longuiCreateContext(int item_capacity, int buffer_capacity)Creates a new UI context; callMakeCurrentto make this context the current context.static voiduiDestroyContext(long ctx)Releases the memory of an UI context created withCreateContext; if the context is the current context, the current context will be set toNULL.static voiduiEndLayout()Layout all added items starting from the root item 0.static intuiFindItem(int item, int x, int y, int flags, int mask)Returns the topmost item containing absolute location(x,y), starting withitemas parent, using a set of flags and masks as filter.static intuiFirstChild(int item)Returns the first child item of a container item.static voiduiFocus(int item)Sets item as recipient of all keyboard events.static intuiGetAllocSize()Returns the total bytes that have been allocated byAllocHandlestatic intuiGetBox(int item)Returns the box model as set bySetBox.static booleanuiGetButton(int button)Returns the current state of an application dependent input button as set bySetButton.static intuiGetClicks()Returns the number of chained clicks; 1 is a single click, 2 is a double click, etc.static longuiGetContext()Returns the currently selected context orNULL.static UIVec2uiGetCursor(UIVec2 __result)Returns the current cursor position in screen coordinates as set bySetCursor.static UIVec2uiGetCursorDelta(UIVec2 __result)Returns the offset of the cursor relative to the last call toProcess.static UIVec2uiGetCursorStart(UIVec2 __result)Returns the beginning point of a drag operation.static UIVec2uiGetCursorStartDelta(UIVec2 __result)Returns the offset of the cursor relative to the beginning point of a drag operation.static intuiGetEvents(int item)Returns the event flags for an item as passed toSetEventsstatic intuiGetFlags(int item)Returns the user-defined flags for an item as passed toSetFlagsstatic intuiGetFocusedItem()Returns the item that is currently focused or -1 for none.static longuiGetHandle(int item)Returns the application-dependent handle of the item as passed toSetHandleorAllocHandle.static UIHandleruiGetHandler()Returns the handler callback as passed toSetHandlerstatic intuiGetHeight(int item)Return the height of the item as set bySetSize.static intuiGetHotItem()Returns the item that is currently under the cursor or -1 for none.static intuiGetItemCount()Returns the total number of allocated itemsstatic intuiGetKey()When handling aKEY_DOWN/KEY_UPevent: the key that triggered this event.static intuiGetLastItemCount()Returns the number if items that have been allocated in the last frame.static intuiGetLayout(int item)Returns the anchoring behavior as set bySetLayout.static shortuiGetMarginDown(int item)Returns the bottom margin of the item as set withSetMargins.static shortuiGetMarginLeft(int item)Returns the left margin of the item as set withSetMargins.static shortuiGetMarginRight(int item)Returns the right margin of the item as set withSetMargins.static shortuiGetMarginTop(int item)Returns the top margin of the item as set withSetMargins.static intuiGetModifier()When handling a keyboard or mouse event: the active modifier keys.static UIRectuiGetRect(int item, UIRect __result)Returns the items layout rectangle in absolute coordinates.static UIVec2uiGetScroll(UIVec2 __result)Returns the currently accumulated scroll wheel offsets for this framestatic intuiGetState(int item)Returns the current state of the item.static intuiGetWidth(int item)Returns the width of the item as set bySetSize.static intuiInsert(int item, int child)Assigns an item to a container.static intuiInsertBack(int item, int child)Inserts child into container item likeInsert, but prepend it to the first child item, effectively putting it in the background.static intuiInsertFront(int item, int child)Same asInsert.static intuiItem()Creates a new UI item and return the new item's ID.static voiduiMakeCurrent(long ctx)Selects an UI context as the current context; a context must always be selected before using any of the other UI functions.static intuiNextSibling(int item)Returns an items next sibling in the list of the parent containers children.static voiduiProcess(int timestamp)Updates the internal state according to the current cursor position and button states, and call all registered handlers.static intuiRecoverItem(int olditem)WhenBeginLayoutis called, the most recently declared items are retained.static voiduiRemapItem(int olditem, int newitem)In cases where it is important to recover old state over changes in the view, and the built-in remapping fails, the UI declaration can manually remap old items to new IDs in cases where e.g.static voiduiSetBox(int item, int flags)Sets the box model behavior of the item to one or multipleUIboxFlags.static voiduiSetButton(int button, int mod, boolean enabled)Sets a mouse or gamepad button as pressed/released button is in the range0..63and maps to an application defined input source.static voiduiSetChar(int value)Sends a single character for text input; the character is usually in the unicode range, but can be application defined.static voiduiSetCursor(int x, int y)Sets the current cursor position (usually belonging to a mouse) to the screen coordinates at(x,y).static voiduiSetEvents(int item, int flags)static voiduiSetFlags(int item, int flags)static voiduiSetFrozen(int item, boolean enable)Sets an items state to frozen.static voiduiSetHandle(int item, long handle)Sets the application-dependent handle of an item.static voiduiSetHandler(UIHandlerI handler)Sets the global handler callback for interactive items.static voiduiSetKey(int key, int mod, boolean enabled)Sets a key as down/up; the key can be any application definedkeycode.static voiduiSetLayout(int item, int flags)Sets the anchoring behavior of the item to one or multipleUIlayoutFlags.static voiduiSetMargins(int item, int l, int t, int r, int b)Sets the left, top, right and bottom margins of an item.static voiduiSetScroll(int x, int y)Accumulates scroll wheel offsets for the current frame.static voiduiSetSize(int item, int w, int h)Sets the size of the item.static voiduiUpdateHotItem()Updates the current hot item; this only needs to be called if items are kept for more than one frame andEndLayoutis not called.
-
-
-
Field Detail
-
UI_ROW, UI_COLUMN, UI_LAYOUT, UI_FLEX, UI_NOWRAP, UI_WRAP, UI_START, UI_MIDDLE, UI_END, UI_JUSTIFY
Container flags to pass toSetBox. (UIboxFlags)Enum values:
ROW- left to rightCOLUMN- top to bottomLAYOUT- free layoutFLEX- flex modelNOWRAP- single-lineWRAP- multi-line, wrap left to rightSTART- justify-content (start, end, center, space-between) at start of row/columnMIDDLE- at center of row/columnEND- at end of row/columnJUSTIFY- insert spacing to stretch across whole row/column
-
UI_LEFT, UI_TOP, UI_RIGHT, UI_DOWN, UI_HFILL, UI_VFILL, UI_HCENTER, UI_VCENTER, UI_CENTER, UI_FILL, UI_BREAK
Child layout flags to pass toSetLayout. (UIlayoutFlags)Enum values:
LEFT- anchor to left item or left side of parentTOP- anchor to top item or top side of parentRIGHT- anchor to right item or right side of parentDOWN- anchor to bottom item or bottom side of parentHFILL- anchor to both left and right item or parent bordersVFILL- anchor to both top and bottom item or parent bordersHCENTER- center horizontally, with left margin as offsetVCENTER- center vertically, with top margin as offsetCENTER- center in both directions, with left/top margin as offsetFILL- anchor to all four directionsBREAK- when wrapping, put this element on a new line.Wrapping layout code auto-inserts
UI_BREAKflags, drawing routines can read them withGetLayout.
-
UI_BUTTON0_DOWN, UI_BUTTON0_UP, UI_BUTTON0_HOT_UP, UI_BUTTON0_CAPTURE, UI_BUTTON2_DOWN, UI_SCROLL, UI_KEY_DOWN, UI_KEY_UP, UI_CHAR
Event flags. (UIevent)Enum values:
BUTTON0_DOWN- on button 0 downBUTTON0_UP- on button 0 up when this event has a handler,GetStatewill returnACTIVEas long as button 0 is downBUTTON0_HOT_UP- on button 0 up while item is hovered when this event has a handler,GetStatewill returnACTIVEwhen the cursor is hovering the items rectangle; this is the behavior expected for buttonsBUTTON0_CAPTURE- item is being captured (button 0 constantly pressed); when this event has a handler,GetStatewill returnACTIVEas long as button 0 is downBUTTON2_DOWN- on button 2 down (right mouse button, usually triggers context menu)SCROLL- item has received a scrollwheel event the accumulated wheel offset can be queried withGetScrollKEY_DOWN- item is focused and has received a key-down event the respective key can be queried usingGetKeyandGetModifierKEY_UP- item is focused and has received a key-up event the respective key can be queried usingGetKeyandGetModifierCHAR- item is focused and has received a character event the respective character can be queried usingGetKey
-
-
Method Detail
-
uiCreateContext
public static long uiCreateContext(int item_capacity, int buffer_capacity)Creates a new UI context; callMakeCurrentto make this context the current context.The context is managed by the client and must be released using
DestroyContext.- Parameters:
item_capacity- the maximum number of items that can be declared. 4096 is a good starting value.buffer_capacity- the maximum total size of bytes that can be allocated usingAllocHandle; you may pass 0 if you don't need to allocate handles.(1<<20)is a good starting value.
-
uiMakeCurrent
public static void uiMakeCurrent(long ctx)
Selects an UI context as the current context; a context must always be selected before using any of the other UI functions.
-
nuiDestroyContext
public static void nuiDestroyContext(long ctx)
Unsafe version of:DestroyContext
-
uiDestroyContext
public static void uiDestroyContext(long ctx)
Releases the memory of an UI context created withCreateContext; if the context is the current context, the current context will be set toNULL.
-
uiGetContext
public static long uiGetContext()
Returns the currently selected context orNULL.
-
uiSetCursor
public static void uiSetCursor(int x, int y)Sets the current cursor position (usually belonging to a mouse) to the screen coordinates at(x,y).
-
nuiGetCursor
public static void nuiGetCursor(long __result)
Unsafe version of:GetCursor
-
uiGetCursor
public static UIVec2 uiGetCursor(UIVec2 __result)
Returns the current cursor position in screen coordinates as set bySetCursor.
-
nuiGetCursorDelta
public static void nuiGetCursorDelta(long __result)
Unsafe version of:GetCursorDelta
-
uiGetCursorDelta
public static UIVec2 uiGetCursorDelta(UIVec2 __result)
Returns the offset of the cursor relative to the last call toProcess.
-
nuiGetCursorStart
public static void nuiGetCursorStart(long __result)
Unsafe version of:GetCursorStart
-
uiGetCursorStart
public static UIVec2 uiGetCursorStart(UIVec2 __result)
Returns the beginning point of a drag operation.
-
nuiGetCursorStartDelta
public static void nuiGetCursorStartDelta(long __result)
Unsafe version of:GetCursorStartDelta
-
uiGetCursorStartDelta
public static UIVec2 uiGetCursorStartDelta(UIVec2 __result)
Returns the offset of the cursor relative to the beginning point of a drag operation.
-
nuiSetButton
public static void nuiSetButton(int button, int mod, int enabled)Unsafe version of:SetButton
-
uiSetButton
public static void uiSetButton(int button, int mod, boolean enabled)Sets a mouse or gamepad button as pressed/released button is in the range0..63and maps to an application defined input source.- Parameters:
mod- an application defined set of flags for modifier keysenabled- is 1 for pressed, 0 for released
-
nuiGetButton
public static int nuiGetButton(int button)
Unsafe version of:GetButton
-
uiGetButton
public static boolean uiGetButton(int button)
Returns the current state of an application dependent input button as set bySetButton.- Returns:
- 1 if the button has been set to pressed, 0 for released
-
uiGetClicks
public static int uiGetClicks()
Returns the number of chained clicks; 1 is a single click, 2 is a double click, etc.
-
nuiSetKey
public static void nuiSetKey(int key, int mod, int enabled)Unsafe version of:SetKey
-
uiSetKey
public static void uiSetKey(int key, int mod, boolean enabled)Sets a key as down/up; the key can be any application definedkeycode.All key events are being buffered until the next call to
Process.- Parameters:
mod- an application defined set of flags for modifier keysenabled- 1 for key down, 0 for key up
-
uiSetChar
public static void uiSetChar(int value)
Sends a single character for text input; the character is usually in the unicode range, but can be application defined.All char events are being buffered until the next call to
Process.
-
uiSetScroll
public static void uiSetScroll(int x, int y)Accumulates scroll wheel offsets for the current frame.All offsets are being accumulated until the next call to
Process.
-
nuiGetScroll
public static void nuiGetScroll(long __result)
Unsafe version of:GetScroll
-
uiGetScroll
public static UIVec2 uiGetScroll(UIVec2 __result)
Returns the currently accumulated scroll wheel offsets for this frame
-
uiBeginLayout
public static void uiBeginLayout()
Clears the item buffer.uiBeginLayout()should be called before the first UI declaration for this frame to avoid concatenation of the same UI multiple times. After the call, all previously declared item IDs are invalid, and all application dependent context data has been freed.uiBeginLayout()must be followed byEndLayout.
-
uiEndLayout
public static void uiEndLayout()
Layout all added items starting from the root item 0.After calling
uiEndLayout(), no further modifications to the item tree should be done until the next call toBeginLayout. It is safe to immediately draw the items after a call touiEndLayout().This is an
O(N)operation forN = number of declared items.
-
uiUpdateHotItem
public static void uiUpdateHotItem()
Updates the current hot item; this only needs to be called if items are kept for more than one frame andEndLayoutis not called.
-
uiProcess
public static void uiProcess(int timestamp)
Updates the internal state according to the current cursor position and button states, and call all registered handlers.No further modifications to the item tree should be done until the next call to
BeginLayout. Items should be drawn before a call touiProcess().This is an
O(N)operation forN = number of declared items.- Parameters:
timestamp- the time in milliseconds relative to the last call touiProcess()and is used to estimate the threshold for double-clicks after callinguiProcess().
-
uiClearState
public static void uiClearState()
Resets the currently stored hot/active etc. handles.This should be called when a re-declaration of the UI changes the item indices, to avoid state related glitches because item identities have changed.
-
uiItem
public static int uiItem()
Creates a new UI item and return the new item's ID.
-
nuiSetFrozen
public static void nuiSetFrozen(int item, int enable)Unsafe version of:SetFrozen
-
uiSetFrozen
public static void uiSetFrozen(int item, boolean enable)Sets an items state to frozen.The UI will not recurse into frozen items when searching for hot or active items; subsequently, frozen items and their child items will not cause mouse event notifications. The frozen state is not applied recursively;
GetStatewill reportCOLDfor child items. Upon encountering a frozen item, the drawing routine needs to handle rendering of child items appropriately.
-
uiSetHandle
public static void uiSetHandle(int item, long handle)Sets the application-dependent handle of an item.- Parameters:
handle- an application defined 64-bit handle. IfNULL, the item will not be interactive.
-
nuiAllocHandle
public static long nuiAllocHandle(int item, int size)Unsafe version of:AllocHandle
-
uiAllocHandle
@Nullable public static java.nio.ByteBuffer uiAllocHandle(int item, int size)Allocates space for application-dependent context data and assign it as the handle to the item.The memory of the pointer is managed by the UI context and released upon the next call to
BeginLayout.
-
nuiSetHandler
public static void nuiSetHandler(long handler)
Unsafe version of:SetHandler
-
uiSetHandler
public static void uiSetHandler(UIHandlerI handler)
Sets the global handler callback for interactive items.The handler will be called for each item whose event flags are set using
SetEvents.
-
uiSetEvents
public static void uiSetEvents(int item, int flags)- Parameters:
flags- designates for which events the handler should be called. One or more of:BUTTON0_DOWNBUTTON0_UPBUTTON0_HOT_UPBUTTON0_CAPTUREBUTTON2_DOWNSCROLLKEY_DOWNKEY_UPCHAR
-
uiSetFlags
public static void uiSetFlags(int item, int flags)- Parameters:
flags- a user-defined set of flags defined byUSERMASK
-
uiInsert
public static int uiInsert(int item, int child)Assigns an item to a container.An item ID of 0 refers to the root item. The function searches for the last item and calls
Appendon it, which is anO(N)operation forNsiblings. It is usually more efficient to calluiInsert() for the first child, then chain additional siblings usinguiAppend().- Returns:
- the child item ID if the container has already added items
-
uiAppend
public static int uiAppend(int item, int sibling)Assigns an item to the same container as another item.- Parameters:
sibling- inserted afteritem
-
uiInsertBack
public static int uiInsertBack(int item, int child)Inserts child into container item likeInsert, but prepend it to the first child item, effectively putting it in the background.It is efficient to call
uiInsertBack()repeatedly in cases where drawing or layout order doesn't matter.
-
uiInsertFront
public static int uiInsertFront(int item, int child)Same asInsert.
-
uiSetSize
public static void uiSetSize(int item, int w, int h)Sets the size of the item.A size of 0 indicates the dimension to be dynamic; if the size is set, the item can not expand beyond that size.
-
uiSetLayout
public static void uiSetLayout(int item, int flags)Sets the anchoring behavior of the item to one or multipleUIlayoutFlags.
-
uiSetBox
public static void uiSetBox(int item, int flags)Sets the box model behavior of the item to one or multipleUIboxFlags.
-
nuiSetMargins
public static void nuiSetMargins(int item, short l, short t, short r, short b)Unsafe version of:SetMargins
-
uiSetMargins
public static void uiSetMargins(int item, int l, int t, int r, int b)Sets the left, top, right and bottom margins of an item.When the item is anchored to the parent or another item, the margin controls the distance from the neighboring element.
-
uiFocus
public static void uiFocus(int item)
Sets item as recipient of all keyboard events.- Parameters:
item- if -1, no item will be focused
-
uiFirstChild
public static int uiFirstChild(int item)
Returns the first child item of a container item.If the item is not a container or does not contain any items, -1 is returned.
- Parameters:
item- if 0, the first child item of the root item will be returned
-
uiNextSibling
public static int uiNextSibling(int item)
Returns an items next sibling in the list of the parent containers children.If
itemis 0 or the item is the last child item, -1 will be returned.
-
uiGetItemCount
public static int uiGetItemCount()
Returns the total number of allocated items
-
uiGetAllocSize
public static int uiGetAllocSize()
Returns the total bytes that have been allocated byAllocHandle
-
uiGetState
public static int uiGetState(int item)
-
uiGetHandle
public static long uiGetHandle(int item)
Returns the application-dependent handle of the item as passed toSetHandleorAllocHandle.
-
uiGetHotItem
public static int uiGetHotItem()
Returns the item that is currently under the cursor or -1 for none.
-
uiGetFocusedItem
public static int uiGetFocusedItem()
Returns the item that is currently focused or -1 for none.
-
uiFindItem
public static int uiFindItem(int item, int x, int y, int flags, int mask)Returns the topmost item containing absolute location(x,y), starting withitemas parent, using a set of flags and masks as filter.If both
flagsandmaskareANY, the first topmost item is returned. IfmaskisANY, the first topmost item matching any of flags is returned. otherwise the first item matching(item.flags & flags) == maskis returned. You may combine box, layout, event and user flags. Frozen items will always be ignored.
-
nuiGetHandler
public static long nuiGetHandler()
Unsafe version of:GetHandler
-
uiGetHandler
@Nullable public static UIHandler uiGetHandler()
Returns the handler callback as passed toSetHandler
-
uiGetEvents
public static int uiGetEvents(int item)
Returns the event flags for an item as passed toSetEvents
-
uiGetFlags
public static int uiGetFlags(int item)
Returns the user-defined flags for an item as passed toSetFlags
-
uiGetKey
public static int uiGetKey()
When handling aKEY_DOWN/KEY_UPevent: the key that triggered this event.
-
uiGetModifier
public static int uiGetModifier()
When handling a keyboard or mouse event: the active modifier keys.
-
nuiGetRect
public static void nuiGetRect(int item, long __result)Unsafe version of:GetRect
-
uiGetRect
public static UIRect uiGetRect(int item, UIRect __result)
Returns the items layout rectangle in absolute coordinates.If
uiGetRect()is called beforeEndLayout, the values of the returned rectangle are undefined.
-
nuiContains
public static int nuiContains(int item, int x, int y)Unsafe version of:Contains
-
uiContains
public static boolean uiContains(int item, int x, int y)Returns 1 if an items absolute rectangle contains a given coordinate, otherwise 0.
-
uiGetWidth
public static int uiGetWidth(int item)
Returns the width of the item as set bySetSize.
-
uiGetHeight
public static int uiGetHeight(int item)
Return the height of the item as set bySetSize.
-
uiGetLayout
public static int uiGetLayout(int item)
Returns the anchoring behavior as set bySetLayout.
-
uiGetBox
public static int uiGetBox(int item)
Returns the box model as set bySetBox.
-
uiGetMarginLeft
public static short uiGetMarginLeft(int item)
Returns the left margin of the item as set withSetMargins.
-
uiGetMarginTop
public static short uiGetMarginTop(int item)
Returns the top margin of the item as set withSetMargins.
-
uiGetMarginRight
public static short uiGetMarginRight(int item)
Returns the right margin of the item as set withSetMargins.
-
uiGetMarginDown
public static short uiGetMarginDown(int item)
Returns the bottom margin of the item as set withSetMargins.
-
uiRecoverItem
public static int uiRecoverItem(int olditem)
WhenBeginLayoutis called, the most recently declared items are retained. WhenEndLayoutcompletes, it matches the old item hierarchy to the new one and attempts to map old items to new items as well as possible. When passed an item Id from the previous frame,uiRecoverItem()returns the item's new assumed Id, or -1 if the item could not be mapped. It is valid to pass -1 as item.
-
uiRemapItem
public static void uiRemapItem(int olditem, int newitem)In cases where it is important to recover old state over changes in the view, and the built-in remapping fails, the UI declaration can manually remap old items to new IDs in cases where e.g. the previous item ID has been temporarily saved;uiRemapItem()would then be called after creating the new item usingItem.
-
uiGetLastItemCount
public static int uiGetLastItemCount()
Returns the number if items that have been allocated in the last frame.
-
-