<?xml version="1.0" encoding="utf-8"?> <Screen name="UITest" descriptors="xworker.libgdx.Screen"> <Resources> <FileResource name="skin" type="skin" file="\data\uiskin.json"></FileResource> <FileResource name="texture1" type="texture" file="\data\badlogicsmall.jpg"></FileResource> <FileResource name="texture2" type="texture" file="\data\badlogic.jpg"></FileResource> <TextureRegion name="image" constructor="texture" texture="texture1"></TextureRegion> <TextureRegion name="imageFlipped" constructor="textureRegion" textureRegion="image" flipX="true" flipY="true"></TextureRegion> <TextureRegion name="image2" constructor="texture" texture="texture2"></TextureRegion> <ScreenViewport name="viewPort" constructor="default"></ScreenViewport> <ResourceGroup name="sytes"> <ButtonStyle name="buttonStyle" constructor="fromSkin" skin="skin"></ButtonStyle> <ImageButtonStyle name="imageButtonStyle" constructor="buttonStyle" up="image" down="imageFlipped" buttonStyle="buttonStyle"></ImageButtonStyle> </ResourceGroup> </Resources> <Actors> <Dialog name="dialog" constructor="title_skin" title="Some Dialog" skin="skin" text="Are you enjoying this demo?" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false" pack="false" layout="false"> <Buttons> <TextButtonWithObject name="yesButton" text="Yes" object="true"></TextButtonWithObject> <TextButtonWithObject name="noButton" text="No" object="false"></TextButtonWithObject> </Buttons> <Keys> <Key name="enter" key="Enter" object="true"></Key> <Key name="escape" key="Escape" object="false"></Key> </Keys> <actions> <GroovyAction name="result" code="println("Dialog result is " + object);"></GroovyAction> </actions> </Dialog> </Actors> <Stages> <Stage name="stage" _xmeta_id_="Stage" constructor="viewport" viewport="viewPort"> <Window name="window" constructor="title_skin" title="Dialog" skin="skin" isResizable="false" resizeBorder="3" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false" pack="true" layout="false" positionX="0" positionY="0"> <TitleTable debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"> <ActorCell name="titleCell" _xmeta_id_="ActorCell" height="ognl:window.getPadTop()"> <Actors> <TextButton name="titleTextButton" constructor="text_skin" skin="skin" text="X" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"></TextButton> </Actors> </ActorCell> </TitleTable> <Defaults spaceBottom="10"></Defaults> <NewRow expandX="true" expandY="true" fill="true"></NewRow> <ImageButton name="iconButton" constructor="style" style="imageButtonStyle" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"> <EventListeners> <ChangeListener name="sliderChangeListener"> <actions> <GroovyAction name="changed" code="dialog.show(stage);"></GroovyAction> </actions> </ChangeListener> </EventListeners> </ImageButton> <TextButton name="buttonMulti" constructor="text_skin_styleName" skin="skin" styleName="toggle" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"> <text><![CDATA[Multi Line Toggle]]></text> </TextButton> <Button name="imgButton" constructor="up" up="image" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"></Button> <Button name="imgToggleButton" constructor="child_skin_styleName" skin="skin" styleName="toggle" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"> <ChildActor> <Image name="imgToggleButtonImg" constructor="texture" texture="texture1"></Image> </ChildActor> </Button> <NewRow _xmeta_id_="NewRow1"></NewRow> <CheckBox name="checkBox" constructor="text_skin" text="Continuous rendering" skin="skin" checkBoxLeft="false" debug="false" debugCell="false" debugTable="false" debugWidget="false" defaults="false"> <EventListeners> <ChangeListener name="sliderChangeListener"> <actions> <GroovyAction name="changed"> <code><![CDATA[import com.badlogic.gdx.Gdx; Gdx.graphics.setContinuousRendering(checkBox.isChecked());]]></code> </GroovyAction> </actions> </ChangeListener> </EventListeners> </CheckBox> <ActorCell name="sliderCell" _xmeta_id_="slider" colspan="3" fillX="true" minWidth="100"> <Actors> <Slider name="slider" constructor="min_max_stepSize_vertical_skin" min="0" max="10" stepSize="1" vertical="false" skin="skin"> <EventListeners> <ChangeListener name="sliderChangeListener"> <actions> <GroovyAction name="changed"> <code><![CDATA[import com.badlogic.gdx.Gdx; Gdx.app.log("UITest", "slider: " + slider.getValue());]]></code> </GroovyAction> </actions> </ChangeListener> </EventListeners> </Slider> </Actors> </ActorCell> <NewRow _xmeta_id_="NewRow2"></NewRow> <ActorCell name="selectBoxCell" maxWidth="100"> <Actors> <SelectBox name="selectBox" constructor="skin" skin="skin" selectItem="Linux6"> <actions> <GroovyAction name="getItems"> <code><![CDATA[return ["Android1", "Windows1 long text in item", "Linux1", "OSX1", "Android2", "Windows2", "Linux2", "OSX2", "Android3", "Windows3", "Linux3", "OSX3", "Android4", "Windows4", "Linux4", "OSX4", "Android5", "Windows5", "Linux5", "OSX5", "Android6", "Windows6", "Linux6", "OSX6", "Android7", "Windows7", "Linux7", "OSX7"] as String[];]]></code> </GroovyAction> </actions> <EventListeners> <ChangeListener name="sliderChangeListener"> <actions> <GroovyAction name="changed" code="System.out.println(selectBox.getSelected());"></GroovyAction> </actions> </ChangeListener> </EventListeners> </SelectBox> </Actors> </ActorCell> <ActorCell name="textfieldCell" colspan="3" expandX="true" expandY="true" fillX="true" minWidth="100"> <Actors> <TextField name="textfield" constructor="text_skin" skin="skin" alignment="center" messageText="Click here!"> <EventListeners></EventListeners> <TextFieldListener> <actions> <GroovyAction name="keyTyped" code="if (key == '\n') textField.getOnscreenKeyboard().show(false);"></GroovyAction> </actions> </TextFieldListener> </TextField> </Actors> </ActorCell> <NewRow _xmeta_id_="NewRow3"></NewRow> <ActorCell name="splitPaneCell" colspan="4" expandX="true" expandY="true" fill="true" fillX="true" maxHeight="200"> <Actors> <SplitPane name="splitPane" constructor="skin_styleName" vertical="false" skin="skin" styleName="default-horizontal"> <FirstWidget> <ScrollPane name="scrollPane" constructor="actor"> <ChildActor> <Image name="imageActor" constructor="texture" texture="texture2"></Image> </ChildActor> </ScrollPane> </FirstWidget> <SecondWidget> <ScrollPane name="scrollPane2" constructor="actor_skin" skin="skin" flickScroll="false"> <ChildActor> <List name="list" constructor="skin" skin="skin"> <actions> <GroovyAction name="getItems"> <code><![CDATA[return ["This is a list entry1", "And another one1", "The meaning of life1", "Is hard to come by1", "This is a list entry2", "And another one2", "The meaning of life2", "Is hard to come by2", "This is a list entry3", "And another one3", "The meaning of life3", "Is hard to come by3", "This is a list entry4", "And another one4", "The meaning of life4", "Is hard to come by4", "This is a list entry5", "And another one5", "The meaning of life5", "Is hard to come by5"] as String[];]]></code> </GroovyAction> </actions> <Selection multiple="true" required="false"></Selection> </List> </ChildActor> </ScrollPane> </SecondWidget> </SplitPane> </Actors> </ActorCell> <NewRow _xmeta_id_="NewRow4"></NewRow> <ActorCell name="passwordLabel" colspan="2"> <Actors> <Label name="passwordLabel" constructor="text_skin" skin="skin" text="Textfield in password mode:"></Label> </Actors> </ActorCell> <ActorCell name="passwordTextFieldCell" colspan="2" expandY="true" fillX="true" minWidth="100"> <Actors> <TextField name="passwordTextField" constructor="text_skin" skin="skin" messageText="password" passwordCharacter="*" passwordMode="true"></TextField> </Actors> </ActorCell> <NewRow _xmeta_id_="NewRow5"></NewRow> <ActorCell name="fpsLabelCell" colspan="4"> <Actors> <Label name="fpsLabel" constructor="text_skin" skin="skin" text="fps:"></Label> </Actors> </ActorCell> </Window> </Stage> </Stages> <actions> <GroovyAction name="render"> <code><![CDATA[import com.badlogic.gdx.Gdx; fpsLabel.setText("fps: " + Gdx.graphics.getFramesPerSecond());]]></code> </GroovyAction> </actions> </Screen>
Copyright © 2007-2019 XWorker.org 版权所有 沪ICP备08000575号