Buttons not showing up

Help and discussion regarding skinning, themes, and other artistic content.

Moderators: CEGUI MVP, CEGUI Team

ara
Just popping in
Just popping in
Posts: 17
Joined: Sat Jul 12, 2008 01:08

Buttons not showing up

Postby ara » Tue Aug 05, 2008 04:59

so i have a menu in which the buttons work, but they dont show their hover or pressed states.

now, whats interesting about this is that the worked with our old placeholder imageset, but now that im trying to get all the new art in they dont.

so, my emediant thought was that the button was the same in all positions on the imageset. i checked and they wernt.

my next thought was that the coords were the same

Code: Select all

    <Image Name="Video" XPos="1" YPos="931" Width="363" Height="61" />
    <Image Name="VideoHov" XPos="1" YPos="993" Width="363" Height="61" />
    <Image Name="VideoPre" XPos="1" YPos="1055" Width="363" Height="61" />
    <Image Name="Sound" XPos="1" YPos="1117" Width="363" Height="61" />
    <Image Name="SoundHov" XPos="1" YPos="1179" Width="363" Height="61" />
    <Image Name="SoundPre" XPos="1" YPos="1241" Width="363" Height="61" />
    <Image Name="mBack" XPos="365" YPos="937" Width="363" Height="61" />
    <Image Name="mBackHov" XPos="365" YPos="999" Width="363" Height="61" />
    <Image Name="mBackPre" XPos="365" YPos="1061" Width="363" Height="61" />
    <Image Name="Controls" XPos="365" YPos="1123" Width="363" Height="61" />
    <Image Name="ControlsHov" XPos="365" YPos="1185" Width="363" Height="61"/>
    <Image Name="ControlsPre" XPos="365" YPos="1247" Width="363" Height="61"/>


so they arnt.

it worked before. no idea why its breaking now. the log doesnt come across any errors

actually i take that back
it actually says

Code: Select all

05/08/2008 14:55:15 (InfL1)   ---- Successfully completed loading of GUI layout from 'bbSettings.layout' ----
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'UseStandardImagery' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'NormalImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'HoverImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'PushedImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'UseStandardImagery' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'NormalImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'HoverImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'PushedImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'UseStandardImagery' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'NormalImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'HoverImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'PushedImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'UseStandardImagery' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'NormalImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'HoverImage' available in the set.
05/08/2008 14:55:15 (Error)   Exception: There is no Property named 'PushedImage' available in the set.


the layout looks like this

Code: Select all

<GUILayout >
    <Window Type="DefaultWindow" Name="bbMenuSettings" >
   <Property Name="InheritsAlpha" Value="False" />
   <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
   <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
   <Window Type="bbUI/Backgrounds/Menu" Name="bbMenuSettings/Background" >
       <Property Name="FrameEnabled" Value="False" />
       <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
       <Property Name="UnifiedAreaRect" Value="{{0.276562,0},{0.191858,0},{0.708203,0},{0.654325,0}}" />
       <Property Name="BackgroundEnabled" Value="False" />
       <Window Type="bbUI/Settings/Controls" Name="Settings/Controls" >
      <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
      <Property Name="UnifiedAreaRect" Value="{{0.105035,0},{0.170382,0},{0.903174,0},{0.319272,0}}" />
       </Window>
       <Window Type="bbUI/Settings/Video" Name="Settings/Video" >
      <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
      <Property Name="UnifiedAreaRect" Value="{{0.220023,0},{0.329136,0},{0.754215,0},{0.471395,0}}" />
       </Window>
       <Window Type="bbUI/Settings/Sound" Name="Settings/Sound" >
      <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
      <Property Name="UnifiedAreaRect" Value="{{0.230687,0},{0.493683,0},{0.770701,0},{0.643539,0}}" />
       </Window>

       <Window Type="bbUI/MainMenu/Back" Name="Settings/Back" >
      <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
      <Property Name="UnifiedAreaRect" Value="{{0.293589,0},{0.667563,0},{0.716959,0},{0.812571,0}}" />
       </Window>

   </Window>
    </Window>
</GUILayout>


one of the buttons that doesnt work.

Code: Select all

   <!--
      bbUI/Settings/Video
   -->
   <WidgetLook name="bbUI/Settings/Video">
      <ImagerySection name="norm">
         <ImageryComponent>
            <Area>
               <Dim type="LeftEdge">
                  <AbsoluteDim value="0"/>
               </Dim>
               <Dim type="TopEdge">
                  <AbsoluteDim value="0"/>
               </Dim>
               <Dim type="RightEdge">
                  <UnifiedDim scale="1" type="Width"/>
               </Dim>
               <Dim type="BottomEdge">
                  <UnifiedDim scale="1" type="Width"/>
               </Dim>
            </Area>
            <Image imageset="bbButtons" image="Video"/>
            <VertFormat type="TopAligned" />
            <HorzFormat type="CentreAligned" />
         </ImageryComponent>
      </ImagerySection>
      <ImagerySection name="hov">
         <ImageryComponent>
            <Area>
               <Dim type="LeftEdge">
                  <AbsoluteDim value="0"/>
               </Dim>
               <Dim type="TopEdge">
                  <AbsoluteDim value="0"/>
               </Dim>
               <Dim type="RightEdge">
                  <UnifiedDim scale="1" type="Width"/>
               </Dim>
               <Dim type="BottomEdge">
                  <UnifiedDim scale="1" type="Width"/>
               </Dim>
            </Area>
            <Image imageset="bbButtons" image="VideoHov"/>
            <VertFormat type="TopAligned" />
            <HorzFormat type="CentreAligned" />
         </ImageryComponent>
      </ImagerySection>
      <ImagerySection name="pre">
         <ImageryComponent>
            <Area>
               <Dim type="LeftEdge">
                  <AbsoluteDim value="0"/>
               </Dim>
               <Dim type="TopEdge">
                  <AbsoluteDim value="0"/>
               </Dim>
               <Dim type="RightEdge">
                  <UnifiedDim scale="1" type="Width"/>
               </Dim>
               <Dim type="BottomEdge">
                  <UnifiedDim scale="1" type="Width"/>
               </Dim>
            </Area>
            <Image imageset="bbButtons" image="VideoPre"/>
            <VertFormat type="TopAligned" />
            <HorzFormat type="CentreAligned" />
         </ImageryComponent>
      </ImagerySection>
      <StateImagery name="Normal">
         <Layer>
            <Section section="norm" />
         </Layer>
      </StateImagery>
      <StateImagery name="Hover">
         <Layer>
            <Section section="norm" />
         </Layer>
      </StateImagery>
      <StateImagery>
         <Layer>
            <Section section="pre" />
         </Layer>
      </StateImagery>
   </WidgetLook>



any ideas?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Aug 05, 2008 07:32

Hi,

it seems that you have removed too much from the looknfeel file. Since you obviously map it to a PushButton, the rendering system at least expects these properties:

*NormalImage
*HoverImage
*PushedImage

Also, looking at your layout i notice that you seem to have a lot of widget types, one for each setting and such. You should know that a looknfeel is very generic. You should be able (IMO) to make one new button look, and use it for all your button controls. That will save you a lot of copy&pasting :) Like OO programming, consider the looknfeel the 'class' and your widgets the 'instances', so to speak.

With propertydefinitions (mentioned earlier) in place, you can use this from your layout:

Code: Select all

<Property Name="NormalImage" Value="set:bbButtons image:Video" />
or
<Property Name="NormalImage" Value="set:bbButtons image:Sound" />


HTH.
Last edited by scriptkid on Tue Aug 05, 2008 13:50, edited 1 time in total.
Check out my released snake game using Cegui!

ara
Just popping in
Just popping in
Posts: 17
Joined: Sat Jul 12, 2008 01:08

Postby ara » Tue Aug 05, 2008 08:44

ive never actually had to use property definitions, code like that (indeed i think that all the buttons that work are exactly the same, to the point were i copy pasted them)

You should be able (IMO) to make one new button look, and use it for all your button controls. That will save you a lot of copy&pasting


yeah, unfortunatly due to time constraints i just jumped right into writing it without investigating everything.
pros: i have an almost working GUI and probably wont run over time.
cons: its a bit messier than i would like.

so you say that i can assign different images in the layout file ontop of a generic button? im wishing i had have found that out earlyer but anyway. ill try setting those in the layout file tomorrow morning and see what happens. thanks.

ara
Just popping in
Just popping in
Posts: 17
Joined: Sat Jul 12, 2008 01:08

Postby ara » Tue Aug 05, 2008 23:27

i added the property defs into into the layout file so it now looks like

Code: Select all

 <Window Type="bbUI/Settings/Video" Name="Settings/Video" >
      <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
      <Property Name="UnifiedAreaRect" Value="{{0.220023,0},{0.329136,0},{0.754215,0},{0.471395,0}}" />
      <Property Name="NormalImage" Value="set:bbButtons image:Video"/>
      <Property Name="HoverImage" Value="set:bbButtons image:VideoHov"/>
      <Property Name="PushedImage" Value="set:bbButtons image:VideoPre"/>
       </Window>


and it still doesnt work.

Edit: yeah, i changed the looknfeel it was refrencing to one that i knew worked and just changed to that button, so the property lines sont seem to do anything.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Aug 06, 2008 08:24

You also need <PropertyDefinition> elements in the looknfeel (as mentioned by scriptkid), and then some <ImagerySection> / <ImageryComponent> elements to draw the images referenced in the defined properties; there is no hard coded support for these properties - it's all done via the skinning system.

CE.


Return to “Skins and Themes”

Who is online

Users browsing this forum: No registered users and 19 guests