public class LazyGuiSettings
extends java.lang.Object
gui = new LazyGui(this, new LazyGuiSettings()
.setLoadLatestSaveOnStartup(false)
.setAutosaveOnExit(false)
// ...
);
| Constructor and Description |
|---|
LazyGuiSettings()
Constructor, call this before any other function here.
|
| Modifier and Type | Method and Description |
|---|---|
LazyGuiSettings |
setAutosaveLockGuardEnabled(boolean autosaveLockGuardEnabled)
When the lock guard is enabled it checks whether the last frame took too long and does not autosave if it did.
|
LazyGuiSettings |
setAutosaveLockGuardMillisLimit(int autosaveLockGuardMillisLimit)
The millis limit for the last frame for the autosave lock guard to take effect and block autosaving.
|
LazyGuiSettings |
setAutosaveOnExit(boolean autosaveEnabled)
Should the GUI try to autosave its state before closing gracefully?
|
LazyGuiSettings |
setAutosuggestWindowWidth(boolean shouldAutosuggest)
Override the GUI trying to make window widths fit its contents snugly based on longest text in the row at window opening time.
|
LazyGuiSettings |
setCellSize(float cellSize)
This sets the cell size that all gui controls use to draw themselves.
|
LazyGuiSettings |
setCustomGuiDataFolder(java.lang.String customPath)
Set a custom data folder for the gui to use for json saves and png screenshots.
|
LazyGuiSettings |
setDefaultGradientBlendType(java.lang.String defaultGradientBlendType)
Set the default gradient blend type for all gradient control elements.
|
LazyGuiSettings |
setHideBuiltInFolders(boolean shouldHideFolders)
Should the built-in folders start hidden?
That is the automatically created gui folders like "options" and "saves".
|
LazyGuiSettings |
setHideRadioValue(boolean hideRadioValue)
Hide the selected value text on the right of the radio row and replace it with a generic folder icon.
|
LazyGuiSettings |
setHotkeyMouseWheelActive(boolean shouldMouseChangePrecision)
The mouse wheel changes a slider's precision when hovering over it.
|
LazyGuiSettings |
setKeyboardDelay(int millisDelayToSet)
Set the delay in milliseconds for the keyboard buffer to be considered a new input.
|
LazyGuiSettings |
setLoadLatestSaveOnStartup(boolean loadLatestSaveOnStartup)
When this is set to false it disables the default attempt to load the latest save.
|
LazyGuiSettings |
setLoadSpecificSaveOnStartup(java.lang.String fileName)
Loads a specific save file on startup, tries to look inside the save folder for the file first before assuming the user gave the absolute path.
|
LazyGuiSettings |
setLoadSpecificSaveOnStartupOnce(java.lang.String fileName)
Loads a specific save file on startup if the gui finds its save folder empty.
|
LazyGuiSettings |
setMainFontSize(int mainFontSize)
This sets the main font size used everywhere by the gui.
|
LazyGuiSettings |
setMouseConfineToWindow(boolean mouseShouldConfineToWindow)
Should the mouse be locked inside the sketch window? You can still exit the sketch with ESC.
|
LazyGuiSettings |
setMouseHideWhenDragging(boolean mouseShouldHideWhenDragging)
Should the mouse be hidden when dragging a slider or a plot?
Hiding the mouse can give the user a more immersive feeling, but it can also be disorienting.
|
LazyGuiSettings |
setOverwriteLastLoadedSave(boolean overwriteLastLoadedSave)
Sets the custom new save file name to be the same as the last loaded save file whenever a save is loaded.
|
LazyGuiSettings |
setShowSquigglyEqualsInsideSliders(boolean showSquigglyEquals)
Show the approximately equals double tilde '≈' in sliders when visually shown values are not exactly equal to the actual float values used by the program.
|
LazyGuiSettings |
setSideFontSize(int sideFontSize)
This sets the usually smaller side font size used in a few places by the gui.
|
LazyGuiSettings |
setSketchNameOverride(java.lang.String sketchNameOverride)
Overrides what the root window title displays.
|
LazyGuiSettings |
setSmooth(int smoothValue)
Override the default antialiasing level of `smooth(4)` for the GUI canvas.
|
LazyGuiSettings |
setStartGuiHidden(boolean shouldHideGui)
Should the gui start hidden? Toggle hiding with the 'H' hotkey.
|
LazyGuiSettings |
setThemeCustom(int windowBorderColor,
int normalBackgroundColor,
int focusBackgroundColor,
int normalForegroundColor,
int focusForegroundColor)
Sets a custom theme defined by individual hex colors.
|
LazyGuiSettings |
setThemePreset(java.lang.String themePreset)
Sets one theme from the preset options on startup.
|
LazyGuiSettings |
setWindowRestoreAlways()
The GUI will always load window positions, sizes and openness on startup and then always try to overwrite them when loading other saves.
|
LazyGuiSettings |
setWindowRestoreNever()
The GUI will never load window positions, sizes and openness.
|
LazyGuiSettings |
setWindowRestoreOnlyOnStartup()
The GUI will load window positions, sizes and openness on startup and then ignore any saved window states when loading other saves.
|
public LazyGuiSettings()
* gui = new LazyGui(this, new LazyGuiSettings() * .setLoadLatestSaveOnStartup(false) * .setAutosaveOnExit(false) * // ... * ); *
public LazyGuiSettings setThemePreset(java.lang.String themePreset)
themePreset - selected preset, one of "dark", "light", "pink", "blue"public LazyGuiSettings setThemeCustom(int windowBorderColor, int normalBackgroundColor, int focusBackgroundColor, int normalForegroundColor, int focusForegroundColor)
windowBorderColor - color of the window bordernormalBackgroundColor - normal background colorfocusBackgroundColor - focus background colornormalForegroundColor - normal foreground colorfocusForegroundColor - focus foreground colorpublic LazyGuiSettings setHideBuiltInFolders(boolean shouldHideFolders)
gui.show("options") and gui.show("saves")shouldHideFolders - whether the built-in folders should start hiddensetLoadLatestSaveOnStartup(boolean),
setAutosaveOnExit(boolean)public LazyGuiSettings setStartGuiHidden(boolean shouldHideGui)
shouldHideGui - whether the gui should start hiddenpublic LazyGuiSettings setLoadLatestSaveOnStartup(boolean loadLatestSaveOnStartup)
loadLatestSaveOnStartup - load the last modified save when gui starts?public LazyGuiSettings setLoadSpecificSaveOnStartup(java.lang.String fileName)
fileName - name of the save file inside the save folder to load in the format "1" or "1.json" or a full absolute path to it anywhere on disksetLoadLatestSaveOnStartup(boolean),
setLoadSpecificSaveOnStartupOnce(String)public LazyGuiSettings setLoadSpecificSaveOnStartupOnce(java.lang.String fileName)
fileName - name of the save file to load in the format "1" or "1.json" in the save folder or a full absolute path to it anywhere on disksetLoadLatestSaveOnStartup(boolean),
setLoadSpecificSaveOnStartup(String)public LazyGuiSettings setAutosaveOnExit(boolean autosaveEnabled)
autosaveEnabled - should the sketch try to save when closingpublic LazyGuiSettings setAutosaveLockGuardEnabled(boolean autosaveLockGuardEnabled)
autosaveLockGuardEnabled - should the autosave be guarded against saving badsetAutosaveLockGuardMillisLimit(int)public LazyGuiSettings setAutosaveLockGuardMillisLimit(int autosaveLockGuardMillisLimit)
autosaveLockGuardMillisLimit - last frame limit in millissetAutosaveLockGuardEnabled(boolean)public LazyGuiSettings setMouseHideWhenDragging(boolean mouseShouldHideWhenDragging)
mouseShouldHideWhenDragging - should the mouse hide when dragging an element like a slider?public LazyGuiSettings setMouseConfineToWindow(boolean mouseShouldConfineToWindow)
mouseShouldConfineToWindow - confine mouse to sketch windowpublic LazyGuiSettings setCellSize(float cellSize)
cellSize - global cell sizepublic LazyGuiSettings setMainFontSize(int mainFontSize)
mainFontSize - main font sizesetThemeCustom(int, int, int, int, int)public LazyGuiSettings setSideFontSize(int sideFontSize)
sideFontSize - side font sizesetThemeCustom(int, int, int, int, int)public LazyGuiSettings setSketchNameOverride(java.lang.String sketchNameOverride)
sketchNameOverride - name to display in root window titlepublic LazyGuiSettings setAutosuggestWindowWidth(boolean shouldAutosuggest)
shouldAutosuggest - should the windows try to auto-detect optimal width?public LazyGuiSettings setSmooth(int smoothValue)
smoothValue - the value to be passed to `smooth()` for the gui canvas - if 0 then `noSmooth()` is usedpublic LazyGuiSettings setHideRadioValue(boolean hideRadioValue)
hideRadioValue - whether to hide the radio value textpublic LazyGuiSettings setShowSquigglyEqualsInsideSliders(boolean showSquigglyEquals)
SliderNode.displaySquigglyEqualsand the related SliderNode constructor that sets it.
showSquigglyEquals - whether to show the squiggly equals '≈' in sliders where the underlying values are not exactly what is shownpublic LazyGuiSettings setHotkeyMouseWheelActive(boolean shouldMouseChangePrecision)
shouldMouseChangePrecision - whether the mouse wheel should change the precision of the sliderpublic LazyGuiSettings setKeyboardDelay(int millisDelayToSet)
millisDelayToSet - the delay in millisecondspublic LazyGuiSettings setCustomGuiDataFolder(java.lang.String customPath)
customPath - the custom path to set, "gui" by defaultpublic LazyGuiSettings setWindowRestoreOnlyOnStartup()
public LazyGuiSettings setWindowRestoreAlways()
public LazyGuiSettings setWindowRestoreNever()
public LazyGuiSettings setDefaultGradientBlendType(java.lang.String defaultGradientBlendType)
defaultGradientBlendType - one of the allowed strings in the gradient "blend" radio options - "mix", "hsv", "oklab"public LazyGuiSettings setOverwriteLastLoadedSave(boolean overwriteLastLoadedSave)
LazyGui.createSave(String) ignores the custom save name, because the parameter already contains a file name.
LazyGui.createSave() respects the custom save name or picks the next free integer when the custom name is empty.overwriteLastLoadedSave - whether to overwrite the custom save name with the last loaded save name