GUI

open class GUI(val appearance: GUIAppearance = GUIAppearance(), val defaultStyles: List<StyleSheet> = defaultStyles()) : Extension(source)

Constructors

Link copied to clipboard
constructor(appearance: GUIAppearance = GUIAppearance(), defaultStyles: List<StyleSheet> = defaultStyles())

Types

Link copied to clipboard
class ParameterValue(var doubleValue: Double? = null, var intValue: Int? = null, var booleanValue: Boolean? = null, var colorValue: ColorRGBa? = null, var vector2Value: Vector2? = null, var vector3Value: Vector3? = null, var vector4Value: Vector4? = null, var doubleListValue: MutableList<Double>? = null, var textValue: String? = null, var optionValue: String? = null, var minValue: Double? = null, var maxValue: Double? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var enabled: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <T : Any> add(objectWithParameters: T, label: String? = objectWithParameters.title()): T

Add an object to the GUI

fun <T : Any> add(label: String? = null, builder: () -> T): T

Add an object to the GUI using a builder.

Link copied to clipboard
open override fun afterDraw(drawer: Drawer, program: Program)
Link copied to clipboard
open fun beforeDraw(drawer: Drawer, program: Program)
Link copied to clipboard

Can be called by the user to update the gui using an object deserialized externally. Allows the user to load a larger json object, deserialize it, and use part of it to update the GUI. Complements .toObject().

Link copied to clipboard
fun loadParameters(file: File)
Link copied to clipboard
fun onChange(listener: (name: String, value: Any?) -> Unit)
Link copied to clipboard
fun randomize(strength: Double = 0.05)
Link copied to clipboard
fun saveParameters(file: File)
Link copied to clipboard
open override fun setup(program: Program)
Link copied to clipboard
open override fun shutdown(program: Program)
Link copied to clipboard

Can be called by the user to obtain an object to be serialized externally. This allows the user to combine custom data with gui state and save it all to one file. Complements .fromObject().