Class Settings
-
- All Implemented Interfaces:
public final class SettingsSettings for PolyUI.
This contains many values that concern the rendering and event handling of PolyUI internally.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumSettings.ResourcePolicyHow to handle resource (image and font) loading errors.
-
Field Summary
Fields Modifier and Type Field Description private Booleandebugprivate BooleanenableDebugKeybindprivate IntegermaxFPSprivate IntegerunfocusedFPSprivate BooleanuseAntialiasingprivate BooleanenableVSyncprivate StringdefaultLocaleprivate Settings.ResourcePolicyresourcePolicyprivate BooleanmasterIsFramebufferprivate IntegerminDrawablesForFramebufferprivate BooleandraggablesOnTopprivate BooleanframebuffersEnabledprivate BooleanrenderPausingEnabledprivate LongcomboMaxIntervalprivate IntegermaxComboSizeprivate BooleanclearComboWhenMaxedprivate Pair<Integer, Integer>scrollMultiplierprivate BooleannaturalScrollingprivate Pair<Integer, Integer>minimumWindowSizeprivate Pair<Integer, Integer>maximumWindowSizeprivate Pair<Integer, Integer>windowAspectRatioprivate BooleancleanupAfterInitprivate BooleancleanupOnShutdownprivate BooleanloadTranslationsOnInitprivate BooleanparallelLoading
-
Constructor Summary
Constructors Constructor Description Settings()
-
Method Summary
Modifier and Type Method Description final BooleangetDebug()this enables the debug renderer and various other debug features, including more verbose checks and logging. final UnitsetDebug(Boolean debug)this enables the debug renderer and various other debug features, including more verbose checks and logging. final BooleangetEnableDebugKeybind()enable the debug keybind in the window (Ctrl+Shift+I) final UnitsetEnableDebugKeybind(Boolean enableDebugKeybind)enable the debug keybind in the window (Ctrl+Shift+I) final IntegergetMaxFPS()set this to something other than 0 to set a framerate cap for the UI. final UnitsetMaxFPS(Integer maxFPS)set this to something other than 0 to set a framerate cap for the UI. final IntegergetUnfocusedFPS()set this to something other than 0 to change the framerate from the current maxFPS to this value when it is unfocused. final UnitsetUnfocusedFPS(Integer unfocusedFPS)set this to something other than 0 to change the framerate from the current maxFPS to this value when it is unfocused. final BooleangetUseAntialiasing()final UnitsetUseAntialiasing(Boolean useAntialiasing)final BooleangetEnableVSync()final UnitsetEnableVSync(Boolean enableVSync)final StringgetDefaultLocale()final UnitsetDefaultLocale(String defaultLocale)final Settings.ResourcePolicygetResourcePolicy()How to handle resource (image and font) loading errors. final UnitsetResourcePolicy(Settings.ResourcePolicy resourcePolicy)How to handle resource (image and font) loading errors. final BooleangetMasterIsFramebuffer()If true, the renderer will render all layout and component to a 'master' framebuffer, then every frame, render that. final UnitsetMasterIsFramebuffer(Boolean masterIsFramebuffer)If true, the renderer will render all layout and component to a 'master' framebuffer, then every frame, render that. final IntegergetMinDrawablesForFramebuffer()minimum number of drawables in a layout (and its children) before it will use a framebuffer. final UnitsetMinDrawablesForFramebuffer(Integer minDrawablesForFramebuffer)minimum number of drawables in a layout (and its children) before it will use a framebuffer. final BooleangetDraggablesOnTop()Weather or not the system should promote dragging drawables to the top of the render queue. final UnitsetDraggablesOnTop(Boolean draggablesOnTop)Weather or not the system should promote dragging drawables to the top of the render queue. final BooleangetFramebuffersEnabled()Enable or disable framebuffers. final UnitsetFramebuffersEnabled(Boolean framebuffersEnabled)Enable or disable framebuffers. final BooleangetRenderPausingEnabled()This optimization enables "render pausing", or allowing the renderer to pause rendering when there are no changes to the UI. final UnitsetRenderPausingEnabled(Boolean renderPausingEnabled)This optimization enables "render pausing", or allowing the renderer to pause rendering when there are no changes to the UI. final LonggetComboMaxInterval()the time between clicks for them to be considered as a combo. final UnitsetComboMaxInterval(Long comboMaxInterval)the time between clicks for them to be considered as a combo. final IntegergetMaxComboSize()maximum amount of clicks that can be combo-ed in any interval final UnitsetMaxComboSize(Integer maxComboSize)maximum amount of clicks that can be combo-ed in any interval final BooleangetClearComboWhenMaxed()if true, the combo will be cleared when it reaches maxComboSize. final UnitsetClearComboWhenMaxed(Boolean clearComboWhenMaxed)if true, the combo will be cleared when it reaches maxComboSize. final Pair<Integer, Integer>getScrollMultiplier()Scroll multiplier factor, which will multiply the returned value of the callback by this value. final UnitsetScrollMultiplier(Pair<Integer, Integer> scrollMultiplier)Scroll multiplier factor, which will multiply the returned value of the callback by this value. final BooleangetNaturalScrolling()Weather to invert the scroll direction final UnitsetNaturalScrolling(Boolean naturalScrolling)Weather to invert the scroll direction final Pair<Integer, Integer>getMinimumWindowSize()Set the minimum window size (width by height) that the window can be resized to. final UnitsetMinimumWindowSize(Pair<Integer, Integer> minimumWindowSize)Set the minimum window size (width by height) that the window can be resized to. final Pair<Integer, Integer>getMaximumWindowSize()Set the maximum window size (width by height) that the window can be resized to. final UnitsetMaximumWindowSize(Pair<Integer, Integer> maximumWindowSize)Set the maximum window size (width by height) that the window can be resized to. final Pair<Integer, Integer>getWindowAspectRatio()Set the window aspect ratio, with the ratio being width:height, e.g. final UnitsetWindowAspectRatio(Pair<Integer, Integer> windowAspectRatio)Set the window aspect ratio, with the ratio being width:height, e.g. final BooleangetCleanupAfterInit()This property will explicitly clean up after the initialization of PolyUI, calling the garbage collector to free up temporary objects created during initialization. final UnitsetCleanupAfterInit(Boolean cleanupAfterInit)This property will explicitly clean up after the initialization of PolyUI, calling the garbage collector to free up temporary objects created during initialization. final BooleangetCleanupOnShutdown()This property will run the cleanup() method in a shutdown hook which will free memory used by PolyUI. final UnitsetCleanupOnShutdown(Boolean cleanupOnShutdown)This property will run the cleanup() method in a shutdown hook which will free memory used by PolyUI. final BooleangetLoadTranslationsOnInit()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. final UnitsetLoadTranslationsOnInit(Boolean loadTranslationsOnInit)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. final BooleangetParallelLoading()Enable parallel loading of translation files. final UnitsetParallelLoading(Boolean parallelLoading)Enable parallel loading of translation files. -
-
Method Detail
-
getDebug
final Boolean getDebug()
this enables the debug renderer and various other debug features, including more verbose checks and logging.
It can be enabled using
-Dpolyui.debug=truein the JVM arguments, or by pressing Ctrl+Shift+I in the application if enabled.
-
setDebug
final Unit setDebug(Boolean debug)
this enables the debug renderer and various other debug features, including more verbose checks and logging.
It can be enabled using
-Dpolyui.debug=truein the JVM arguments, or by pressing Ctrl+Shift+I in the application if enabled.
-
getEnableDebugKeybind
final Boolean getEnableDebugKeybind()
enable the debug keybind in the window (Ctrl+Shift+I)
-
setEnableDebugKeybind
final Unit setEnableDebugKeybind(Boolean enableDebugKeybind)
enable the debug keybind in the window (Ctrl+Shift+I)
-
getMaxFPS
final Integer getMaxFPS()
set this to something other than 0 to set a framerate cap for the UI.
-
setMaxFPS
final Unit setMaxFPS(Integer maxFPS)
set this to something other than 0 to set a framerate cap for the UI.
-
getUnfocusedFPS
final Integer getUnfocusedFPS()
set this to something other than 0 to change the framerate from the current maxFPS to this value when it is unfocused.
-
setUnfocusedFPS
final Unit setUnfocusedFPS(Integer unfocusedFPS)
set this to something other than 0 to change the framerate from the current maxFPS to this value when it is unfocused.
-
getUseAntialiasing
final Boolean getUseAntialiasing()
-
setUseAntialiasing
final Unit setUseAntialiasing(Boolean useAntialiasing)
-
getEnableVSync
final Boolean getEnableVSync()
-
setEnableVSync
final Unit setEnableVSync(Boolean enableVSync)
-
getDefaultLocale
final String getDefaultLocale()
-
setDefaultLocale
final Unit setDefaultLocale(String defaultLocale)
-
getResourcePolicy
final Settings.ResourcePolicy getResourcePolicy()
How to handle resource (image and font) loading errors.
-
setResourcePolicy
final Unit setResourcePolicy(Settings.ResourcePolicy resourcePolicy)
How to handle resource (image and font) loading errors.
-
getMasterIsFramebuffer
final Boolean getMasterIsFramebuffer()
If true, the renderer will render all layout and component to a 'master' framebuffer, then every frame, render that.
-
setMasterIsFramebuffer
final Unit setMasterIsFramebuffer(Boolean masterIsFramebuffer)
If true, the renderer will render all layout and component to a 'master' framebuffer, then every frame, render that.
-
getMinDrawablesForFramebuffer
final Integer getMinDrawablesForFramebuffer()
minimum number of drawables in a layout (and its children) before it will use a framebuffer.
This value should be set to something relatively high, as the performance gain from using a framebuffer only works if there is a large amount of draw calls.
-
setMinDrawablesForFramebuffer
final Unit setMinDrawablesForFramebuffer(Integer minDrawablesForFramebuffer)
minimum number of drawables in a layout (and its children) before it will use a framebuffer.
This value should be set to something relatively high, as the performance gain from using a framebuffer only works if there is a large amount of draw calls.
-
getDraggablesOnTop
final Boolean getDraggablesOnTop()
Weather or not the system should promote dragging drawables to the top of the render queue. This means they are rendered last so look correct.
They will still retain their order relative to each other.
-
setDraggablesOnTop
final Unit setDraggablesOnTop(Boolean draggablesOnTop)
Weather or not the system should promote dragging drawables to the top of the render queue. This means they are rendered last so look correct.
They will still retain their order relative to each other.
-
getFramebuffersEnabled
final Boolean getFramebuffersEnabled()
Enable or disable framebuffers. Please note that PolyUI is designed to work with framebuffers, so disabling them may cause performance issues.
-
setFramebuffersEnabled
final Unit setFramebuffersEnabled(Boolean framebuffersEnabled)
Enable or disable framebuffers. Please note that PolyUI is designed to work with framebuffers, so disabling them may cause performance issues.
-
getRenderPausingEnabled
final Boolean getRenderPausingEnabled()
This optimization enables "render pausing", or allowing the renderer to pause rendering when there are no changes to the UI.
This requires a setup such as
if (polyUI.drew) glfwSwapBuffers(handle)in your main loop.
-
setRenderPausingEnabled
final Unit setRenderPausingEnabled(Boolean renderPausingEnabled)
This optimization enables "render pausing", or allowing the renderer to pause rendering when there are no changes to the UI.
This requires a setup such as
if (polyUI.drew) glfwSwapBuffers(handle)in your main loop.
-
getComboMaxInterval
final Long getComboMaxInterval()
the time between clicks for them to be considered as a combo.
-
setComboMaxInterval
final Unit setComboMaxInterval(Long comboMaxInterval)
the time between clicks for them to be considered as a combo.
-
getMaxComboSize
final Integer getMaxComboSize()
maximum amount of clicks that can be combo-ed in any interval
-
setMaxComboSize
final Unit setMaxComboSize(Integer maxComboSize)
maximum amount of clicks that can be combo-ed in any interval
-
getClearComboWhenMaxed
final Boolean getClearComboWhenMaxed()
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.
-
setClearComboWhenMaxed
final Unit setClearComboWhenMaxed(Boolean clearComboWhenMaxed)
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.
-
getScrollMultiplier
final Pair<Integer, Integer> getScrollMultiplier()
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.
-
setScrollMultiplier
final Unit setScrollMultiplier(Pair<Integer, Integer> scrollMultiplier)
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.
-
getNaturalScrolling
final Boolean getNaturalScrolling()
Weather to invert the scroll direction
-
setNaturalScrolling
final Unit setNaturalScrolling(Boolean naturalScrolling)
Weather to invert the scroll direction
-
getMinimumWindowSize
final Pair<Integer, Integer> getMinimumWindowSize()
Set the minimum window size (width by height) that the window can be resized to.
Set to
-1to disable an axis.
-
setMinimumWindowSize
final Unit setMinimumWindowSize(Pair<Integer, Integer> minimumWindowSize)
Set the minimum window size (width by height) that the window can be resized to.
Set to
-1to disable an axis.
-
getMaximumWindowSize
final Pair<Integer, Integer> getMaximumWindowSize()
Set the maximum window size (width by height) that the window can be resized to.
Set to
-1to disable an axis.
-
setMaximumWindowSize
final Unit setMaximumWindowSize(Pair<Integer, Integer> maximumWindowSize)
Set the maximum window size (width by height) that the window can be resized to.
Set to
-1to disable an axis.
-
getWindowAspectRatio
final Pair<Integer, Integer> getWindowAspectRatio()
Set the window aspect ratio, with the ratio being width:height, e.g.
16 to 9=16:9.While PolyUI will resize the content to this aspect ratio, if the window is not at this aspect ratio it may look odd (content smaller than the window). To prevent this, you must ensure that the window implementation is only allowing resizes to this aspect ratio.
Set to
-1to disable, or0to infer it automatically. Any other value is the aspect ratio.
-
setWindowAspectRatio
final Unit setWindowAspectRatio(Pair<Integer, Integer> windowAspectRatio)
Set the window aspect ratio, with the ratio being width:height, e.g.
16 to 9=16:9.While PolyUI will resize the content to this aspect ratio, if the window is not at this aspect ratio it may look odd (content smaller than the window). To prevent this, you must ensure that the window implementation is only allowing resizes to this aspect ratio.
Set to
-1to disable, or0to infer it automatically. Any other value is the aspect ratio.
-
getCleanupAfterInit
final Boolean getCleanupAfterInit()
This property will explicitly clean up after the initialization of PolyUI, calling the garbage collector to free up temporary objects created during initialization.
This option will usually halve or more the memory usage, but takes time (~10ms). It is recommended for memory limited scenarios and in production.
-
setCleanupAfterInit
final Unit setCleanupAfterInit(Boolean cleanupAfterInit)
This property will explicitly clean up after the initialization of PolyUI, calling the garbage collector to free up temporary objects created during initialization.
This option will usually halve or more the memory usage, but takes time (~10ms). It is recommended for memory limited scenarios and in production.
-
getCleanupOnShutdown
final Boolean getCleanupOnShutdown()
This property will run the cleanup() method in a shutdown hook which will free memory used by PolyUI.
-
setCleanupOnShutdown
final Unit setCleanupOnShutdown(Boolean cleanupOnShutdown)
This property will run the cleanup() method in a shutdown hook which will free memory used by PolyUI.
-
getLoadTranslationsOnInit
final Boolean getLoadTranslationsOnInit()
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.
-
setLoadTranslationsOnInit
final Unit setLoadTranslationsOnInit(Boolean loadTranslationsOnInit)
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.
-
getParallelLoading
final Boolean getParallelLoading()
Enable parallel loading of translation files.
-
setParallelLoading
final Unit setParallelLoading(Boolean parallelLoading)
Enable parallel loading of translation files.
-
-
-
-