Forráskód Böngészése

- SDK: add NiftyGUI example XML files

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8552 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 éve
szülő
commit
3cf87ae5e3

+ 21 - 0
jme3-gui/src/com/jme3/gde/gui/examples/01-button.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel width="25%" height="25%" align="center" valign="center" childLayout="vertical" backgroundColor="#55a5" padding="10">
+        <panel height="*" backgroundColor="#55aa" padding="10">
+          <!-- add your content here -->
+        </panel>
+        <panel height="10px" />
+        <panel height="21px" childLayout="horizontal">
+          <control id="buttonOk" name="button" label="OK" />
+          <panel width="*" />
+          <control id="buttonCancel" name="button" label="Cancel" />
+        </panel>
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 13 - 0
jme3-gui/src/com/jme3/gde/gui/examples/02-chat.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel width="50%" height="50%" align="center" valign="center" childLayout="vertical" backgroundColor="#55a5" padding="10">
+        <control id="chatId" name="nifty-chat" width="100%" height="100%" lines="13" sendLabel="Send Message" />
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 13 - 0
jme3-gui/src/com/jme3/gde/gui/examples/03-checkbox.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel width="50%" height="50%" align="center" valign="center" childLayout="vertical" backgroundColor="#55a5" padding="10">
+        <control id="simpleCheckBox" name="checkbox" checked="true" />
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 11 - 0
jme3-gui/src/com/jme3/gde/gui/examples/04-console.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <control id="console" width="50%" name="nifty-console" lines="25" align="center" valign="center" />
+    </layer>
+  </screen>
+</nifty>

+ 11 - 0
jme3-gui/src/com/jme3/gde/gui/examples/05-dropdown.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <control id="dropDown" width="50%" name="dropDown" align="center" valign="center" />
+    </layer>
+  </screen>
+</nifty>

+ 11 - 0
jme3-gui/src/com/jme3/gde/gui/examples/06-imageselect.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <control id="image-select" name="imageSelect" width="126px" imageWidth="80px" imageHeight="80px" imageList="defaultcontrolsxml/avatar1.png,defaultcontrolsxml/avatar2.png,defaultcontrolsxml/avatar3.png" />
+    </layer>
+  </screen>
+</nifty>

+ 11 - 0
jme3-gui/src/com/jme3/gde/gui/examples/07-label.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <control name="label" text="hello world" align="center" valign="center" />
+    </layer>
+  </screen>
+</nifty>

+ 11 - 0
jme3-gui/src/com/jme3/gde/gui/examples/08-dropdown.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <control id="myListBox" width="50%" height="50%" align="center" valign="center" name="listBox" vertical="optional" horizontal="optional" displayItems="4" selection="Multiple" />
+    </layer>
+  </screen>
+</nifty>

+ 38 - 0
jme3-gui/src/com/jme3/gde/gui/examples/09-radiobutton.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel childLayout="horizontal" align="center" valign="center" width="50%" height="50%" backgroundColor="#55a5" padding="10">
+        <control id="RadioGroup-1" name="radioButtonGroup" />
+        <control name="label" text="Radio Buttons" />
+        <panel width="10" />
+        <panel childLayout="vertical" backgroundColor="#8001" paddingLeft="7px" paddingRight="7px" paddingTop="4px" paddingBottom="4px" width="105px">
+          <effect>
+            <onActive name="border" color="#0008" />
+          </effect>
+          <panel childLayout="horizontal">
+            <control name="label" text="Option 1" with="60px" />
+            <control name="radioButton" id="option-1" group="RadioGroup-1" />
+          </panel>
+          <panel childLayout="horizontal">
+            <control name="label" text="Option 2" with="60px" />
+            <control name="radioButton" id="option-2" group="RadioGroup-1" />
+          </panel>
+          <panel childLayout="horizontal">
+            <control name="label" text="Option 3" with="60px" />
+            <control name="radioButton" id="option-3" group="RadioGroup-1" />
+          </panel>
+          <panel childLayout="horizontal">
+            <control name="label" text="Option 4" with="60px" />
+            <control name="radioButton" id="option-4" group="RadioGroup-1" />
+          </panel>
+        </panel>
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 21 - 0
jme3-gui/src/com/jme3/gde/gui/examples/10-scrollbar.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel childLayout="horizontal" align="center" valign="center" width="50%" height="50%" backgroundColor="#55a5" padding="10">
+        <!-- simple vertical scrollbar -->
+        <control name="verticalScrollbar" worldMax="1000.0" worldPageSize="100.0" initial="10.0" buttonStepSize="10.0" pageStepSize="100.0" />
+
+        <panel width="10px" />
+
+        <!-- simple horizontal scrollbar -->
+        <control name="horizontalScrollbar" worldMax="1000.0" worldPageSize="100.0" initial="10.0" buttonStepSize="10.0" pageStepSize="100.0" />
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 29 - 0
jme3-gui/src/com/jme3/gde/gui/examples/11-scrollpanel.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel childLayout="horizontal" align="center" valign="center" width="50%" height="50%" backgroundColor="#55a5" padding="10">
+        <control id="scrollbarPanelId" name="scrollPanel" horizontal="true" height="100%" width="100%">
+          <!-- first child is the content, the area to scroll around -->
+          <panel id="myScrollStuff" width="1000px" height="1000px" childLayout="vertical">
+            <effect>
+              <onActive name="gradient" direction="vertical">
+                <value offset="0%" color="#ffff" />
+                <value offset="100%" color="#f00f" />
+              </onActive>
+              <onActive name="gradient" direction="horizontal">
+                <value offset="0%" color="#ffff" />
+                <value offset="100%" color="#0f0f" />
+              </onActive>
+            </effect>
+          </panel>
+        </control>
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 17 - 0
jme3-gui/src/com/jme3/gde/gui/examples/12-slider.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel childLayout="horizontal" align="center" valign="center" width="50%" height="50%" backgroundColor="#55a5" padding="10">
+        <control id="sliderV" name="verticalSlider" height="200px" />
+        <panel width="10" />
+        <control id="sliderH" name="horizontalSlider" width="200px" />
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 15 - 0
jme3-gui/src/com/jme3/gde/gui/examples/13-textfield.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer childLayout="center">
+      <panel width="25%" height="25%" align="center" valign="center" childLayout="vertical" backgroundColor="#55a5" padding="10">
+        <control name="textfield" />
+      </panel>
+    </layer>
+  </screen>
+</nifty>

+ 15 - 0
jme3-gui/src/com/jme3/gde/gui/examples/14-window.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
+  <useStyles filename="nifty-default-styles.xml" />
+  <useControls filename="nifty-default-controls.xml" />
+
+  <screen id="start">
+    <layer id="windows" childLayout="absolute">
+      <control id="window-3" name="window" title="You can drag me around..." width="500px" height="400px" x="400px">
+        <text text="I'm a window!" style="base-font" color="#eeef" valign="center" width="100%" />
+      </control>
+    </layer>
+  </screen>
+</nifty>

BIN
jme3-gui/src/com/jme3/gde/gui/examples/avatar1.png


BIN
jme3-gui/src/com/jme3/gde/gui/examples/avatar2.png


BIN
jme3-gui/src/com/jme3/gde/gui/examples/avatar3.png


+ 56 - 0
jme3-gui/src/com/jme3/gde/gui/layer.xml

@@ -86,6 +86,62 @@
                 <attr name="displayName" bundlevalue="com.jme3.gde.gui.Bundle#Templates/Other/NiftyGuiTemplate.xml"/>
                 <attr name="template" boolvalue="true"/>
             </file>
+            <file name="button.xml" url="examples/01-button.xml">
+                <attr name="displayName" stringvalue="Button Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="chat.xml" url="examples/02-chat.xml">
+                <attr name="displayName" stringvalue="Chat Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="checkbox.xml" url="examples/03-checkbox.xml">
+                <attr name="displayName" stringvalue="Checkbox Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="console.xml" url="examples/04-console.xml">
+                <attr name="displayName" stringvalue="Console Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="dropdown.xml" url="examples/05-dropdown.xml">
+                <attr name="displayName" stringvalue="Dropdown Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="imageselect.xml" url="examples/06-imageselect.xml">
+                <attr name="displayName" stringvalue="Imageselect Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="label.xml" url="examples/07-label.xml">
+                <attr name="displayName" stringvalue="Label Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="dropdown.xml" url="examples/08-dropdown.xml">
+                <attr name="displayName" stringvalue="Dropdown Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="radiobutton.xml" url="examples/09-radiobutton.xml">
+                <attr name="displayName" stringvalue="Radiobutton Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="scrollbar.xml" url="examples/10-scrollbar.xml">
+                <attr name="displayName" stringvalue="Scrollbar Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="scrollpanel.xml" url="examples/11-scrollpanel.xml">
+                <attr name="displayName" stringvalue="Scrollpanel Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="slider.xml" url="examples/12-slider.xml">
+                <attr name="displayName" stringvalue="Slider Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="textfield.xml" url="examples/13-textfield.xml">
+                <attr name="displayName" stringvalue="Textfield Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
+            <file name="window.xml" url="examples/14-window.xml">
+                <attr name="displayName" stringvalue="Window Example"/>
+                <attr name="template" boolvalue="true"/>
+            </file>
         </folder>
     </folder>
     <folder name="NiftyGUIPalette">