Settings

class Settings

Settings for PolyUI.

This contains many values that concern the rendering and event handling of PolyUI internally.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

How to handle resource (image and font) loading errors.

Properties

Link copied to clipboard
@get:JvmName(name = "getAspectRatio")
@set:JvmName(name = "setAspectRatio")
var aspectRatio: Vec2

Set the renderer aspect ratio, with the ratio being width:height, e.g. 16 to 9 = 16:9.

Link copied to clipboard
@get:JvmName(name = "willCleanupAfterInit")
@set:JvmName(name = "enableInitCleanup")
var cleanupAfterInit: Boolean

This property will explicitly clean up after the initialization of PolyUI, calling the garbage collector to free up temporary objects created during initialization.

Link copied to clipboard
@get:JvmName(name = "willCleanupOnShutdown")
@set:JvmName(name = "enableShutdownCleanup")
var cleanupOnShutdown: Boolean

This property will run the cleanup() method in a shutdown hook which will free memory used by PolyUI.

Link copied to clipboard
@get:JvmName(name = "enableComboClearing")
@set:JvmName(name = "shouldClearComboWhenMaxed")
var clearComboWhenMaxed: Boolean

if true, the combo will be cleared when it reaches maxComboSize. Otherwise, it will just continue to dispatch the max event for future clicks if they are within the combo frame.

Link copied to clipboard

the time between clicks for them to be considered as a combo.

Link copied to clipboard
@get:JvmName(name = "isDebugMode")
@set:JvmName(name = "enableDebugMode")
var debug: Boolean

this enables the debug renderer and various other debug features, including more verbose checks and logging.

Link copied to clipboard
Link copied to clipboard

The threshold for a drag to be considered a 'drag', meaning the drag event will begin to be dispatched, in pixels.

Link copied to clipboard
@get:JvmName(name = "hasDebugKeybind")
@set:JvmName(name = "enableDebugKeybind")
var enableDebugKeybind: Boolean

enable the debug keybind in the window (Ctrl+Shift+I)

Link copied to clipboard
@get:JvmName(name = "isVSyncEnabled")
@set:JvmName(name = "enableVSync")
var enableVSync: Boolean
Link copied to clipboard
@get:JvmName(name = "forceSetsInitialSize")
@set:JvmName(name = "enableForceSettingInitialSize")
var forceSetsInitialSize: Boolean

This property will mean that, if force is true in the resize method, the initial size will be set to the size given.

Link copied to clipboard
@ApiStatus.Experimental
@get:JvmName(name = "framebuffersEnabled")
@set:JvmName(name = "enableFramebuffers")
var framebuffersEnabled: Boolean

Enable or disable framebuffers. Please note that PolyUI is designed to work with framebuffers, so disabling them may cause performance issues.

Link copied to clipboard
@ApiStatus.Experimental
var isMasterFrameBuffer: Boolean

If true, the renderer will render all layout and component to a 'master' framebuffer, then every frame, render that.

Link copied to clipboard
@get:JvmName(name = "shouldLoadTranslationsOnInit")
@set:JvmName(name = "enableTranslationLoadingOnInit")
var loadTranslationsOnInit: Boolean

Set this to true to enable loading of translation keys upon startup, instead of the default behaviour of loading them when they are first used.

Link copied to clipboard

maximum amount of clicks that can be combo-ed in any interval

Link copied to clipboard
var maxFPS: Int

set this to something other than 0 to set a framerate cap for the UI.

Link copied to clipboard
@get:JvmName(name = "getMaximumSize")
@set:JvmName(name = "setMaximumSize")
var maximumSize: Vec2

Set the maximum renderer size (width by height) that this instance can be resized to.

Link copied to clipboard
@ApiStatus.Experimental
var minDrawablesForFramebuffer: Int

minimum number of drawables in a group before it will use a framebuffer.

Link copied to clipboard
@get:JvmName(name = "getMinimumSize")
@set:JvmName(name = "setMinimumSize")
var minimumSize: Vec2

Set the minimum renderer size (width by height) that this instance can be resized to.

Link copied to clipboard
@get:JvmName(name = "isNaturalScrolling")
@set:JvmName(name = "enableNaturalScrolling")
var naturalScrolling: Boolean

Weather to invert the scroll direction

Link copied to clipboard
@get:JvmName(name = "isRenderPausingEnabled")
@set:JvmName(name = "enableRenderPausing")
var renderPausingEnabled: Boolean

This optimization enables "render pausing", or allowing the renderer to pause rendering when there are no changes to the UI.

Link copied to clipboard

How to handle resource (image and font) loading errors.

Link copied to clipboard
@get:JvmName(name = "getScrollMultiplier")
@set:JvmName(name = "setScrollMultiplier")
var scrollMultiplier: Vec2

Scroll multiplier factor, which will multiply the returned value of the callback by this value. First value is the X scroll multiplier, with the second being the Y scroll multiplier.

Link copied to clipboard

set this to something other than 0 to change the framerate from the current maxFPS to this value when it is unfocused.