CEGUI Button

dev-ui
krzys-h 2014-03-02 17:30:27 +01:00
parent 5a1c1b81ea
commit 17a7af5eff
7 changed files with 209 additions and 10 deletions

View File

@ -0,0 +1,37 @@
<?xml version="1.0" ?>
<Imageset imagefile="../../textures/button1.png" name="ColobotButton1" version="2">
<Image name="ButtonBgChecked" width="128" height="128" xPos="0" yPos="0" />
<Image name="ButtonBgHover" width="128" height="128" xPos="128" yPos="0" />
<Image name="ButtonBgNormal" width="128" height="128" xPos="256" yPos="0" />
<Image name="ButtonBgPushed" width="128" height="128" xPos="384" yPos="0" />
<Image name="SomeBar1" width="384" height="64" xPos="512" yPos="0" />
<Image name="SomeBar2" width="384" height="64" xPos="512" yPos="64" />
<Image name="ButtonBgDisabled" width="128" height="128" xPos="896" yPos="0" />
<Image name="Stop" width="128" height="128" xPos="0" yPos="128" />
<Image name="Reset" width="128" height="128" xPos="128" yPos="128" />
<Image name="PreviousObject" width="128" height="256" xPos="256" yPos="128" />
<Image name="Close" width="128" height="128" xPos="384" yPos="128" />
<Image name="Destroy" width="128" height="128" xPos="512" yPos="128" />
<Image name="Camera" width="128" height="128" xPos="640" yPos="128" />
<Image name="Info" width="128" height="128" xPos="768" yPos="128" />
<Image name="ButtonBgUnknown1" width="128" height="128" xPos="896" yPos="128" />
<Image name="Ok" width="128" height="128" xPos="0" yPos="256" />
<Image name="ButtonDead" width="128" height="128" xPos="128" yPos="256" />
<Image name="Help" width="128" height="128" xPos="256" yPos="256" />
<Image name="Select" width="128" height="128" xPos="384" yPos="256" />
<Image name="Solution" width="128" height="128" xPos="512" yPos="256" />
<Image name="Run" width="128" height="128" xPos="640" yPos="256" />
<Image name="Edit" width="128" height="128" xPos="768" yPos="256" />
<Image name="ButtonBgUnknown2" width="128" height="128" xPos="896" yPos="256" />
<Image name="Zoom+" width="128" height="128" xPos="0" yPos="384" />
<Image name="Zoom-" width="128" height="128" xPos="128" yPos="384" />
<Image name="ButtonBgUnknown3" width="128" height="128" xPos="256" yPos="384" />
<Image name="ButtonBgUnknown4" width="128" height="128" xPos="384" yPos="384" />
<Image name="FlyUp" width="128" height="128" xPos="512" yPos="384" />
<Image name="FlyDown" width="128" height="128" xPos="640" yPos="384" />
<Image name="Home" width="128" height="128" xPos="768" yPos="384" />
<Image name="Grab" width="128" height="128" xPos="896" yPos="384" />
</Imageset>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<Imageset autoScaled="vertical" imagefile="../../textures/mouse.png" name="ColobotMouse" nativeHorzRes="640" nativeVertRes="480" version="2">
<Imageset imagefile="../../textures/mouse.png" name="ColobotMouse" version="2">
<Image name="NormalAlpha" width="64" height="64" xPos="0" yPos="0" />
<Image name="Normal" width="64" height="64" xPos="64" yPos="0" />
<Image name="WaitAlpha" width="64" height="64" xPos="128" yPos="0" />

View File

@ -1,16 +1,19 @@
<?xml version="1.0" ?>
<GUILayout version="4">
<Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" />
<Property name="MaxSize" value="{{1,0},{1,0}}" />
<Window type="DefaultWindow" name="root">
<!--<Window type="TaharezLook/FrameWindow" name="testWindow">
<Property name="UnifiedPosition" value="{ {0.25, 0}, {0.25, 0} }" />
<Property name="UnifiedSize" value="{ {0.5, 0}, {0.5, 0} }" />
<Property name="Text" value="Hello World!" />
</Window>-->
<Window type="WindowsLook/StaticText" name="hello_world">
<!--<Window type="WindowsLook/StaticText" name="hello_world">
<Property name="Font" value="dvu_sans-12" />
<Property name="Text" value="CEGUI is working!" />
<Property name="UnifiedMaxSize" value="{{1,0},{1,0}}" />
<Property name="UnifiedAreaRect" value="{{0.06,0},{0.226667,0},{0.415,0},{0.476667,0}}" />
</Window>-->
<Window type="Colobot/ImageButton" name="test_button">
<Property name="Area" value="{{0,0},{0,0},{0,64},{0,64}}" />
<Property name="Disabled" value="false" />
<Property name="Image" value="ColobotButton1/Edit" />
</Window>
</Window>
</GUILayout>

View File

@ -377,7 +377,7 @@
<UnifiedDim scale="1" type="Height"/>
</Dim>
</Area>
<Image name="WindowsLook/CheckboxNormal"/>
<ImageComponent name="Image"/>
<VertFormat type="CentreAligned"/>
<HorzFormat type="LeftAligned"/>
</ImageryComponent>

View File

@ -0,0 +1,154 @@
<?xml version="1.0" ?>
<Falagard version="7">
<WidgetLook name="Colobot/ImageButton">
<PropertyDefinition name="Image" initialValue="ColobotButton1/ButtonDead" redrawOnWrite="true" />
<ImagerySection name="background_normal">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormal" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="background_hover">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgHover" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="background_pushed">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgPushed" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="background_disabled">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgDisabled" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="image">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<ImageProperty name="Image" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<!-- TODO: background_dead = ColobotButton1/Disabled -->
<StateImagery name="Normal">
<Layer>
<Section section="background_normal" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
<StateImagery name="Hover">
<Layer>
<Section section="background_hover" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
<StateImagery name="Pushed">
<Layer>
<Section section="background_pushed" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="background_disabled" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
</WidgetLook>
</Falagard>

View File

@ -1,5 +1,10 @@
<?xml version="1.0" ?>
<GUIScheme version="5" name="Colobot">
<Imageset filename="../imagesets/mouse.imageset" />
<Font filename="../fonts/dvu_sans-12.font" />
<Imageset filename="mouse.imageset" />
<Imageset filename="button1.imageset" />
<LookNFeel filename="colobot.looknfeel" />
<WindowRendererSet filename="CEGUICoreWindowRendererSet" />
<Font filename="dvu_sans-12.font" />
<FalagardMapping windowType="Colobot/ImageButton" targetType="CEGUI/PushButton" renderer="Core/Button" lookNFeel="Colobot/ImageButton" />
</GUIScheme>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 242 KiB