Clickable area problem with a button

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

Moderators: CEGUI MVP, CEGUI Team

shoki
Just popping in
Just popping in
Posts: 3
Joined: Tue May 30, 2006 10:42

Clickable area problem with a button

Postby shoki » Tue May 30, 2006 16:12

Hi there!

Si I'v got a problem, I'm trying to create my own skin with only three buttons and a background.
So to position it very well, I've program it like that :

Code: Select all

<WidgetLook name="LeftButton">

      <ImagerySection name="bgLeftButton">
         <ImageryComponent>
            <Area>
               <Dim type="LeftEdge">
                  <AbsoluteDim value="14" />
               </Dim>
               <Dim type="TopEdge">
                  <AbsoluteDim value="110" />
               </Dim>
               <Dim type="Height">
                  <AbsoluteDim value="209" />
               </Dim>
               <Dim type="Width">
                  <AbsoluteDim value="285" />
               </Dim>
            </Area>
            <Image imageset="Animmersion" image="LeftButtonNormal" />
            <VertFormat type="Stretched" />
            <HorzFormat type="Stretched" />
         </ImageryComponent>
      </ImagerySection>
      
      <ImagerySection name="LeftButtonOver">
         <ImageryComponent>
            <Area>
               <Dim type="LeftEdge">
                  <AbsoluteDim value="14" />
               </Dim>
               <Dim type="TopEdge">
                  <AbsoluteDim value="110" />
               </Dim>
               <Dim type="Height">
                  <AbsoluteDim value="209" />
               </Dim>
               <Dim type="Width">
                  <AbsoluteDim value="285" />
               </Dim>
            </Area>
            <Image imageset="Animmersion" image="LeftButtonOver" />
            <VertFormat type="Stretched" />
            <HorzFormat type="Stretched" />
         </ImageryComponent>
      </ImagerySection>
      
      <StateImagery name="Normal">
         <Layer>
            <Section section="bgLeftButton" />
         </Layer>
      </StateImagery>
      <StateImagery name="Hover">
         <Layer>
            <Section section="LeftButtonOver" />
         </Layer>
      </StateImagery>
   </WidgetLook>


My scheme is like that :

Code: Select all

<FalagardMapping WindowType="LeftButton" TargetType="Falagard/Button" LookNFeel="LeftButton" />


and finally I've that on my layout file :

Code: Select all

<Window Type="LeftButton" Name="LeftButton">
         <Property Name="Position" Value="l:0.000000 t:0.000000 r:0.000000 b:0.000000" />
         <Property Name="RelativeRect" Value="l:0.000000 t:0.000000 r:1.000000 b:1.000000" />
      </Window>


I know that's a static code, you can't use it again for "generic buttons".
All is shown perfectly but the clickable area of my button is the entire screen not only the image rectangle.

I'm sur that it comes from my RelativeRect, i've tried few solutions but nothing wants to work...

I hope someone know where it comes from,
thx a lot,

shoki

P.S. is it possible to not has a "straight" rectangle as hover area, for exemple a circle?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue May 30, 2006 18:39

RelativeRect = l:0 t:0 r:1 b:1 will effectively use 100% of the parent space.
You're telling it to do it.

The ImagerySection only concerns rendering, not what is clickable.

shoki
Just popping in
Just popping in
Posts: 3
Joined: Tue May 30, 2006 10:42

Postby shoki » Tue May 30, 2006 21:02

o, thx a lot, i've found the solution,
and is it possible to have a custom clickable area like a circle?
++, shoki


Return to “Skins and Themes”

Who is online

Users browsing this forum: No registered users and 5 guests