toggle macro work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
9aa7cfe048
commit
14f4607c47
@ -11,11 +11,11 @@ import electrosphere.renderer.ui.elements.Button;
|
||||
import electrosphere.renderer.ui.elements.FormElement;
|
||||
import electrosphere.renderer.ui.elements.Label;
|
||||
import electrosphere.renderer.ui.elements.Slider;
|
||||
import electrosphere.renderer.ui.elements.ToggleInput;
|
||||
import electrosphere.renderer.ui.elements.VirtualScrollable;
|
||||
import electrosphere.renderer.ui.elementtypes.Element;
|
||||
import electrosphere.renderer.ui.elementtypes.ValueElement;
|
||||
import electrosphere.renderer.ui.events.ValueChangeEvent;
|
||||
import electrosphere.renderer.ui.macros.InputMacros;
|
||||
|
||||
/**
|
||||
* Menu generators for creating test visualizations for ui elements
|
||||
@ -36,8 +36,7 @@ public class MenuGeneratorsUITesting {
|
||||
rVal.addChild(backButton);
|
||||
|
||||
//toggle input
|
||||
ToggleInput toggleInput = ToggleInput.createToggleInput();
|
||||
rVal.addChild(toggleInput);
|
||||
rVal.addChild(InputMacros.createToggle("Test Toggle", false, null));
|
||||
|
||||
//actor panel
|
||||
ActorPanel actorPanel = new ActorPanel(Globals.renderingEngine.getOpenGLState(), 500, 100, 500, 500, ActorUtils.createActorFromModelPath("Models/creatures/animals/deer1.fbx"));
|
||||
|
||||
@ -47,7 +47,7 @@ public class ToggleInput extends StandardDrawableElement implements ClickableEle
|
||||
/**
|
||||
* The offset from the center of the bar to place the circle
|
||||
*/
|
||||
private static final float CIRCLE_OFFSET_FROM_CENTER = 0.3f;
|
||||
private static final float CIRCLE_OFFSET_FROM_CENTER = 0.25f;
|
||||
|
||||
/**
|
||||
* The color of the circle
|
||||
@ -62,7 +62,7 @@ public class ToggleInput extends StandardDrawableElement implements ClickableEle
|
||||
/**
|
||||
* The height of the bar relative to the total drawable height
|
||||
*/
|
||||
private static final float BAR_HEIGHT = 0.5f;
|
||||
private static final float BAR_HEIGHT = 0.6f;
|
||||
|
||||
/**
|
||||
* The color of the bar
|
||||
|
||||
@ -8,6 +8,7 @@ import electrosphere.renderer.ui.elements.Slider;
|
||||
import electrosphere.renderer.ui.elements.TextInput;
|
||||
import electrosphere.renderer.ui.elements.ToggleInput;
|
||||
import electrosphere.renderer.ui.events.ValueChangeEvent;
|
||||
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaAlignment;
|
||||
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaFlexDirection;
|
||||
import electrosphere.renderer.ui.elementtypes.ValueElement.ValueChangeEventCallback;
|
||||
|
||||
@ -108,6 +109,7 @@ public class InputMacros {
|
||||
public static Div createToggle(String label, boolean defaultValue, Consumer<ValueChangeEvent> onChange){
|
||||
Div rVal = Div.createDiv();
|
||||
rVal.setFlexDirection(YogaFlexDirection.Row);
|
||||
rVal.setAlignItems(YogaAlignment.Center);
|
||||
|
||||
//the label
|
||||
Label labelEl = Label.createLabel(label);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user