Package de.lessvoid.nifty.builder

Examples of de.lessvoid.nifty.builder.LayerBuilder


        @Override
        public void onStartScreen() {
          nifty.gotoScreen("demo");
        }
      });
      layer(new LayerBuilder("layer") {{
        childLayoutCenter();
        onStartScreenEffect(new EffectBuilder("fade") {{
          length(3000);
          effectParameter("start", "#0");
          effectParameter("end", "#f");
        }});
        onStartScreenEffect(new EffectBuilder("playSound") {{
          startDelay(1400);
          effectParameter("sound", "intro");
        }});
        onActiveEffect(new EffectBuilder("gradient") {{
          effectValue("offset", "0%", "color", "#66666fff");
          effectValue("offset", "85%", "color", "#000f");
          effectValue("offset", "100%", "color", "#44444fff");
        }});
        panel(new PanelBuilder() {{
          alignCenter();
          valignCenter();
          childLayoutHorizontal();
          width("856px");
          panel(new PanelBuilder() {{
            width("300px");
            height("256px");
            childLayoutCenter();
            text(new TextBuilder() {{
              text("Nifty 1.3 Core");
              style("base-font");
              alignCenter();
              valignCenter();
              onStartScreenEffect(new EffectBuilder("fade") {{
                length(1000);
                effectValue("time", "1700", "value", "0.0");
                effectValue("time", "2000", "value", "1.0");
                effectValue("time", "2600", "value", "1.0");
                effectValue("time", "3200", "value", "0.0");
                post(false);
                neverStopRendering(true);
              }});
            }});
          }});
          panel(new PanelBuilder() {{
            alignCenter();
            valignCenter();
            childLayoutOverlay();
            width("256px");
            height("256px");
            onStartScreenEffect(new EffectBuilder("shake") {{
              length(250);
              startDelay(1300);
              inherit();
              effectParameter("global", "false");
              effectParameter("distance", "10.");
            }});
            onStartScreenEffect(new EffectBuilder("imageSize") {{
              length(600);
              startDelay(3000);
              effectParameter("startSize", "1.0");
              effectParameter("endSize", "2.0");
              inherit();
              neverStopRendering(true);
            }});
            onStartScreenEffect(new EffectBuilder("fade") {{
              length(600);
              startDelay(3000);
              effectParameter("start", "#f");
              effectParameter("end", "#0");
              inherit();
              neverStopRendering(true);
            }});
            image(new ImageBuilder() {{
              filename("yin.png");
              onStartScreenEffect(new EffectBuilder("move") {{
                length(1000);
                startDelay(300);
                timeType("exp");
                effectParameter("factor", "6.f");
                effectParameter("mode", "in");
                effectParameter("direction", "left");
              }});
            }});
            image(new ImageBuilder() {{
              filename("yang.png");
              onStartScreenEffect(new EffectBuilder("move") {{
                length(1000);
                startDelay(300);
                timeType("exp");
                effectParameter("factor", "6.f");
                effectParameter("mode", "in");
                effectParameter("direction", "right");
              }});
            }});
          }});
          panel(new PanelBuilder() {{
            width("300px");
            height("256px");
            childLayoutCenter();
            text(new TextBuilder() {{
              text("Nifty 1.3 Standard Controls");
              style("base-font");
              alignCenter();
              valignCenter();
              onStartScreenEffect(new EffectBuilder("fade") {{
                length(1000);
                effectValue("time", "1700", "value", "0.0");
                effectValue("time", "2000", "value", "1.0");
                effectValue("time", "2600", "value", "1.0");
                effectValue("time", "3200", "value", "0.0");
                post(false);
                neverStopRendering(true);
              }});
            }});
          }});
        }});
      }});
      layer(new LayerBuilder() {{
        backgroundColor("#ddff");
        onStartScreenEffect(new EffectBuilder("fade") {{
          length(1000);
          startDelay(3000);
          effectParameter("start", "#0");
View Full Code Here


          "menuButtonScrollPanel", "dialogScrollPanel",
          "menuButtonChatControl", "dialogChatControl",
          "menuButtonDragAndDrop", "dialogDragAndDrop"
      ));
      inputMapping("de.lessvoid.nifty.input.mapping.DefaultInputMapping"); // this will enable Keyboard events for the screen controller
      layer(new LayerBuilder("layer") {{
        backgroundImage("background-new.png");
        childLayoutVertical();
        panel(new PanelBuilder("navigation") {{
          width("100%");
          height("63px");
          backgroundColor("#5588");
          childLayoutHorizontal();
          padding("20px");
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonListBox", "ListBox", "ListBox demonstration\n\nThis example shows adding and removing items from a ListBox\nas well as the different selection modes that are available."));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonDropDown", "DropDown", "DropDown and RadioButton demonstration\n\nThis shows how to dynamically add items to the\nDropDown control as well as the change event."));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonTextField", "TextField", "TextField demonstration\n\nThis example demonstrates the Textfield example using the password\nmode and the input length restriction. It also demonstrates\nall of the new events the Textfield publishes on the Eventbus."));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonSlider", "Slider & Scrollbars", "Sliders and Scrollbars demonstration\n\nThis creates sliders to change a RGBA value and it\ndisplays a scrollbar that can be customized."));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonScrollPanel", "ScrollPanel", "ScrollPanel demonstration\n\nThis simply shows an image and uses the ScrollPanel\nto scroll around its area. You can directly input\nthe x/y position you want the ScrollPanel to scroll to."));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonChatControl", "ChatControl", "Chat Control demonstration\n\nThis control was contributed by Nifty User ractoc. It demonstrates\nhow you can combine Nifty standard controls to build more\ncomplex stuff. In this case we've just included his work as\nanother standard control to Nifty! :)"));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonDragAndDrop", "Drag and Drop", "Drag and Drop demonstration\n\nDrag and Drop has been extended with Nifty 1.3"));
          panel(builders.hspacer("10px"));
          control(MenuButtonControlDefinition.getControlBuilder("menuButtonCredits", "?", "Credits\n\nCredits and Thanks!", "25px"));
        }});
        panel(new PanelBuilder("dialogParent") {{
          childLayoutOverlay();
          width("100%");
          alignCenter();
          valignCenter();
          control(new ControlBuilder("dialogListBox", ListBoxDialogControlDefinition.NAME));
          control(new ControlBuilder("dialogTextField", TextFieldDialogControlDefinition.NAME));
          control(new ControlBuilder("dialogSliderAndScrollbar", SliderAndScrollbarDialogControlDefinition.NAME));
          control(new ControlBuilder("dialogDropDown", DropDownDialogControlDefinition.NAME));
          control(new ControlBuilder("dialogScrollPanel", ScrollPanelDialogControlDefinition.NAME));
          control(new ControlBuilder("dialogChatControl", ChatControlDialogDefinition.NAME));
          control(new ControlBuilder("dialogDragAndDrop", DragAndDropDialogDefinition.NAME));
        }});
      }});
      layer(new LayerBuilder() {{
        childLayoutVertical();
        panel(new PanelBuilder() {{
          height("*");
        }});
        panel(new PanelBuilder() {{
          childLayoutCenter();
          height("50px");
          width("100%");
          backgroundColor("#5588");
          panel(new PanelBuilder() {{
            paddingLeft("25px");
            paddingRight("25px");
            height("50%");
            width("100%");
            alignCenter();
            valignCenter();
            childLayoutHorizontal();
            control(new LabelBuilder() {{
              label("Screen Resolution:");
            }});
            panel(common.hspacer("7px"));
            control(new DropDownBuilder("resolutions") {{
              width("200px");
            }});
            panel(common.hspacer("*"));
            control(new ButtonBuilder("resetScreenButton", "Restart Screen") {{
            }});
          }});
        }});
      }});
      layer(new LayerBuilder("whiteOverlay") {{
        onCustomEffect(new EffectBuilder("renderQuad") {{
          customKey("onResolutionStart");
          length(350);
          neverStopRendering(false);
        }});
View Full Code Here

    // we'll create a new layer on the fly for the hint and because we could really
    // have lots of hints we'll generate a unique id for this new layer
    this.hintLayerId = NiftyIdCreator.generate();
    this.hintPanelId = hintLayerId + "-hint-panel";

    new LayerBuilder(hintLayerId) {{
      childLayoutAbsoluteInside();
      visible(false);
      control(new ControlBuilder(hintPanelId, hintControl) {{
        parameter("hintText", hintText);
        if (hintStyle != null) {
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.builder.LayerBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.