UI.Window
Implements
Index
Constructors
Properties
Methods
- addAdjacentWindow
- close
- debug
- forceRefresh
- frame
- getBackgroundProvider
- getContainer
- getContent
- getContentProvider
- getElementProvider
- getElements
- getEventListener
- getLocation
- getParentWindow
- getProperty
- getScale
- getStyle
- getStyleSafe
- invalidateAllContent
- invalidateBackground
- invalidateDrawing
- invalidateElements
- invalidateForeground
- isBlockingBackground
- isDynamic
- isInventoryNeeded
- isNotFocusable
- isOpened
- isTouchable
- onBackPressed
- open
- postBackgroundRefresh
- postElementRefresh
- postOpen
- preOpen
- putProperty
- removeAdjacentWindow
- runCachePreparation
- setAsGameOverlay
- setBackgroundColor
- setBlockingBackground
- setCloseOnBackPressed
- setContainer
- setContent
- setDebugEnabled
- setDynamic
- setEventListener
- setInventoryNeeded
- setParentWindow
- setStyle
- setTouchable
- updateScrollDimensions
- updateWindowLocation
- updateWindowPositionAndSize
Constructors
constructor
Constructs new UI.Window object with specified bounds.
Parameters
location: WindowLocation
object containing window's bounds. Note that the bounds change the width of the window, but the full width of the window becomes 1000 units.
Returns Window
Properties
closeOnBackPressed
content
elementProvider
elementView
isBackgroundDirty
isForegroundDirty
layout
location
Methods
addAdjacentWindow
Adds another window as adjacent window, so that several windows open at the same time. This allows to divide window into separate parts and treat them separately.
Parameters
window: Window
another window to be added as adjacent
Returns void
close
Closes window without container. Use only if the window was opened without container.
Returns void
debug
Writes debug information about current window to the log.
Returns void
forceRefresh
Returns void
frame
Called up to 66 times a second to update window's content.
Parameters
time: number
current time in milliseconds
Returns void
getBackgroundProvider
Type parameters
Returns T
getContainer
Returns UiAbstractContainer
Currently UI.Container that was used to open this window or null, if the window wasn't opened in container.
getContent
Returns WindowContent
Window's content object (usually specified in the window's constructor).
getContentProvider
Returns IContentProvider
getElementProvider
Type parameters
Returns T
getElements
getEventListener
- since: 2.3.1b116
Gets listener to be notified about window opening/closing events.
Returns WindowEventListener
getLocation
Returns WindowLocation
Window's current location object.
getParentWindow
Returns IWindow
Current window's parent window.
getProperty
Gets custom property by it's name. Custom properties can be used to store some values containing window's current state. Note that these properties are not saved between Inner Core launches.
Type parameters
- T
Parameters
name: string
custom property name
Returns T
Value set by UI.Window.putProperty or null if no value was specified for this name.
getScale
Returns number
Unit size (in pixel) in the window's bounds.
getStyle
Returns Style
Object containing current style of the window.
getStyleSafe
- since: 3.1.0b126
Returns Style
invalidateAllContent
Returns void
invalidateBackground
Returns void
invalidateDrawing
Forces ui drawables of the window to refresh.
Parameters
onCurrentThread: boolean
if
true, the drawables will be refreshed immediately, otherwise refresh event will be posted; ensure you are in the UI thread if you passtrueas the parameter
Returns void
invalidateElements
Forces ui elements of the window to refresh.
Parameters
onCurrentThread: boolean
if
true, the drawables will be refreshed immediately, otherwise refresh event will be posted; ensure you are in the UI thread if you passtrueas the parameter
Returns void
invalidateForeground
Returns void
isBlockingBackground
Returns boolean
trueif window blocks background.
isDynamic
Returns boolean
trueif the window can change it's contents position.
isInventoryNeeded
Returns boolean
trueif the window has an inventory that should be updated.
isNotFocusable
Returns boolean
trueif the window is game overlay,falseotherwise.
isOpened
Returns boolean
trueif the window is opened,falseotherwise.
isTouchable
Returns boolean
trueif the window is touchable,falseotherwise.
onBackPressed
Returns boolean
Whether the window can be closed on pressing back navigation button.
open
Opens window without container.
Returns void
postBackgroundRefresh
Returns void
postElementRefresh
Returns void
postOpen
Returns void
preOpen
Returns void
putProperty
Sets custom property value.
Type parameters
- T
Parameters
name: string
custom property name
value: T
custom property value
Returns void
removeAdjacentWindow
Removes adjacent window from the adjacent windows list.
Parameters
window: Window
another window that was added as adjacent
Returns void
runCachePreparation
Parameters
async: boolean
Returns void
setAsGameOverlay
Allows window to be displayed as game overlay without blocking Minecraft sounds. Note that this drops window's FPS.
Parameters
inGameOverlay: boolean
if
true, the window is opened in PopupWindow to avoid blocking Minecraft sounds
Returns void
setBackgroundColor
Set background color of window.
Parameters
color: number
integer color value (you can specify it using hex value)
Returns void
setBlockingBackground
Specifies whether the window should darken and block background.
Parameters
blockingBackground: boolean
pass
trueif you want the window to block background
Returns void
setCloseOnBackPressed
Gives the property to be closed on pressing back navigation button to the given window.
Parameters
val: boolean
Returns void
setContainer
Sets container for the current window. Be careful when calling it manually. You should prefer opening the window via it. UI.Container.openAs call
Parameters
container: UiAbstractContainer
UI.Container to be associated with current window or
nullto associate no container with current window.
Returns void
setContent
Specifies the content of the window.
Parameters
content: WindowContent
content object to be applied to the window
Returns void
setDebugEnabled
Turns debug mode for the window on and off.
Parameters
enabled: boolean
if
true, additional debug information will be drawn on the window canvas
Returns void
setDynamic
Parameters
dynamic: boolean
specify
true, if the window contains dynamic (animated) elements,falseotherwise. By default all windows are dynamic. Make them static for better performance
Returns void
setEventListener
Sets listener to be notified about window opening/closing events.
Parameters
listener: WindowEventListener
Returns void
setInventoryNeeded
Parameters
inventoryNeeded: boolean
specify
trueif the window requires player's inventory
Returns void
setParentWindow
Sets any window as current window's parent. If current window closes, parent window closes too.
Parameters
parent: IWindow
window to be used as parent window for the current window.
Returns void
setStyle
Overrides style properties of the current style by the values specified in the style parameter.
Parameters
style: BindingSet
js object where keys represent binding names and values represent texture gui names
Returns void
setTouchable
Specifies whether touch events should be handled by this window or passed to underlying windows (to the game). By default all windows are touchable.
Parameters
touchable: boolean
pass
trueif the window should handle touch events,falseotherwise
Returns void
updateScrollDimensions
- since: 2.2.1b96
Returns void
updateWindowLocation
Returns void
updateWindowPositionAndSize
- since: 2.2.1b96
Returns void
Represents window of required size that can be opened in container to provide any required UI facilities.