Class Settings

  • All Implemented Interfaces:

    
    public final class Settings
    
                        

    Settings for PolyUI.

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

    • Constructor Detail

      • Settings

        Settings()
    • Method Detail

      • isDebugMode

         final Boolean isDebugMode()

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

        It can be enabled using -Dpolyui.debug=true in the JVM arguments, or by pressing Ctrl+Shift+I in the application if enabled.

      • enableDebug

         final Unit enableDebug(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=true in the JVM arguments, or by pressing Ctrl+Shift+I in the application if enabled.

      • getMaxFPS

         final Integer getMaxFPS()

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

        Most implementations will only use this if vsync is disabled.

      • setMaxFPS

         final Unit setMaxFPS(Integer maxFPS)

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

        Most implementations will only use this if vsync is disabled.

      • 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.

      • isMasterFrameBuffer

         final Boolean isMasterFrameBuffer()

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

        Since:

        0.18.0

      • setMasterFrameBuffer

         final Unit setMasterFrameBuffer(Boolean isMasterFrameBuffer)

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

        Since:

        0.18.0

      • getMinDrawablesForFramebuffer

         final Integer getMinDrawablesForFramebuffer()

        minimum number of drawables in a group 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 group 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.

      • framebuffersEnabled

         final Boolean framebuffersEnabled()

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

        Since:

        0.18.0

      • enableFramebuffers

         final Unit enableFramebuffers(Boolean framebuffersEnabled)

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

        Since:

        0.18.0

      • isRenderPausingEnabled

         final Boolean isRenderPausingEnabled()

        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.

        Since:

        0.12.0

      • enableRenderPausing

         final Unit enableRenderPausing(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.

        Since:

        0.12.0

      • enableCommandAsControl

         final Unit enableCommandAsControl(Boolean commandActsAsControl)

        If enabled, the command key on Mac will act as control inputs.

        Since:

        0.24.3

      • 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

      • getScrollMultiplier

         final Pair<Float, Float> 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<Float, Float> 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.

      • getMinimumWindowSize

         final Pair<Integer, Integer> getMinimumWindowSize()

        Set the minimum window size (width by height) that the window can be resized to.

        Set to -1 to disable an axis.

        Since:

        0.18.4

      • 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 -1 to disable an axis.

        Since:

        0.18.4

      • getMaximumWindowSize

         final Pair<Integer, Integer> getMaximumWindowSize()

        Set the maximum window size (width by height) that the window can be resized to.

        Set to -1 to disable an axis.

        Since:

        0.18.4

      • 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 -1 to disable an axis.

        Since:

        0.18.4

      • 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 -1 to disable, or 0 to infer it automatically. Any other value is the aspect ratio.

        Since:

        0.18.4

      • 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 -1 to disable, or 0 to infer it automatically. Any other value is the aspect ratio.

        Since:

        0.18.4

      • willCleanupAfterInit

         final Boolean willCleanupAfterInit()

        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.

        Since:

        0.20.0

      • enableInitCleanup

         final Unit enableInitCleanup(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.

        Since:

        0.20.0

      • willCleanupOnShutdown

         final Boolean willCleanupOnShutdown()

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

        Since:

        0.20.1

      • enableShutdownCleanup

         final Unit enableShutdownCleanup(Boolean cleanupOnShutdown)

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

        Since:

        0.20.1

      • shouldLoadTranslationsOnInit

         final Boolean shouldLoadTranslationsOnInit()

        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.

        Since:

        0.21.1

      • enableTranslationLoadingOnInit

         final Unit enableTranslationLoadingOnInit(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.

        Since:

        0.21.1