Interface WidgetKit
public interface WidgetKit
A theme's look for the pieces built-in editor layouts are made of. Layouts decide where pieces
go and what clicks do; the kit decides what each piece looks like, in each
WidgetState.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidbutton(GuiPainter painter, Rect bounds, String label, EditorButton.Role role, WidgetState state) A button with its label centered.default voidfinishPanels(GuiPainter painter) Finishes the panels drawn since the last call, for effects drawn over a whole panel such as outlines.voidhueSlider(GuiPainter painter, Rect bounds, String label, String value, double hue, WidgetState state) Likeslider(GuiPainter, Rect, String, String, double, WidgetState), with a rainbow track.default voidicon(GuiPainter painter, GuiIcon icon, double x, double y, GuiPaint paint) metrics()voidsaturationBrightness(GuiPainter painter, Rect bounds, float hue, float saturation, float brightness, WidgetState state) A saturation and brightness square for one hue, with a marker at the chosen point.saturationBrightnessArea(Rect bounds) voidslider(GuiPainter painter, Rect bounds, String label, String value, double fraction, WidgetState state) A labelled slider showing its value, with step buttons on either side of the track.sliderStep(GuiPainter painter, Rect bounds, int direction) sliderTrack(Rect bounds) voidsurface(GuiPainter painter, Surface surface, Rect bounds, WidgetState state) Fills a rectangle as the given kind of surface.voidtextField(GuiPainter painter, Rect bounds, TextFieldState field, String placeholder, boolean masked, double textScale, WidgetState state) LiketextField(GuiPainter, Rect, TextFieldState, String, boolean, WidgetState), with text attextScale.default voidtextField(GuiPainter painter, Rect bounds, TextFieldState field, String placeholder, boolean masked, WidgetState state) A text field: its box, its text clipped to the box, and a caret while focused.voidtoggle(GuiPainter painter, Rect bounds, String label, boolean on, WidgetState state) A labelled switch.
-
Method Details
-
metrics
KitMetrics metrics() -
textPaint
-
surface
Fills a rectangle as the given kind of surface. -
finishPanels
Finishes the panels drawn since the last call, for effects drawn over a whole panel such as outlines. Built-in layouts call it at the end of each editor. -
icon
-
button
default void button(GuiPainter painter, Rect bounds, String label, EditorButton.Role role, WidgetState state) A button with its label centered. By default aSurface.BUTTONwith the label in the normal text color, muted while disabled, whatever the role. -
slider
void slider(GuiPainter painter, Rect bounds, String label, String value, double fraction, WidgetState state) A labelled slider showing its value, with step buttons on either side of the track.- Parameters:
fraction- Position of the value, 0 to 1
-
hueSlider
void hueSlider(GuiPainter painter, Rect bounds, String label, String value, double hue, WidgetState state) Likeslider(GuiPainter, Rect, String, String, double, WidgetState), with a rainbow track.- Parameters:
hue- 0 to 1
-
sliderTrack
-
sliderStep
- Parameters:
direction- -1 for the decrease button, 1 for the increase button- Returns:
- Where a slider drawn in
boundstakes clicks on that step button
-
toggle
A labelled switch. -
saturationBrightness
void saturationBrightness(GuiPainter painter, Rect bounds, float hue, float saturation, float brightness, WidgetState state) A saturation and brightness square for one hue, with a marker at the chosen point. -
saturationBrightnessArea
-
textField
default void textField(GuiPainter painter, Rect bounds, TextFieldState field, String placeholder, boolean masked, WidgetState state) A text field: its box, its text clipped to the box, and a caret while focused. -
textField
void textField(GuiPainter painter, Rect bounds, TextFieldState field, String placeholder, boolean masked, double textScale, WidgetState state) LiketextField(GuiPainter, Rect, TextFieldState, String, boolean, WidgetState), with text attextScale.
-