How to add the topEdge and bottomEdge for button?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

pyhmail
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Apr 03, 2008 02:37

How to add the topEdge and bottomEdge for button?

Postby pyhmail » Thu Jul 10, 2008 06:09

I found the TaharezLook/button have leftEdge and rightEdge (In the TaharezLook.looknfeel file)
<Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftNormal" />
<Image type="RightEdge" imageset="TaharezLook" image="ButtonRightNormal" />
<Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal"

now I want to add the topEdge and the bottomEdge for the button,what should I do?

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

Postby CrazyEddie » Fri Jul 11, 2008 08:21

Hi,

The Taharez button consists of three components - the two ends and a bit in the middle, hence the existing arrangement.

To add top/bottom edges, you need to specify additional elements within the FrameComponent in the looknfeel file, using the Image type attributes "TopEdge" and "BottomEdge" - of course you will need an imageset with the required images defined, as mentioned these do not exist in the supplied TaharezLook imageset.

So, for example, you might add to the looknfeel:

Code: Select all

<Image type="TopEdge" imageset="TaharezLook" image="ButtonTopNormal" />
<Image type="BottomEdge" imageset="TaharezLook" image="ButtonBottomNormal" />


But you must also add definitions in the TaharezLook.imageset for the images "ButtonTopNormal" and "ButtonBottomNormal".

CE.

pyhmail
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Apr 03, 2008 02:37

TO CrazyEddie

Postby pyhmail » Fri Jul 11, 2008 09:11

I add the RightEdge and BottomEdge in the FrameComponent,as following:

<ImagerySection name="normal">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>

</Area>
<Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
<Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
<Image type="TopEdge" imageset="TaharezLook" image="WindowTopEdge" />
<Image type="BottonEdge" imageset="TaharezLook" image="WindowBottomEdge" />

</FrameComponent>
<ImageryComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>

</Area>
<ImageProperty name="NormalImage" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>

but it's not work?can you tell me what is the reason? thanks!

pyhmail
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Apr 03, 2008 02:37

To CrazyEddie:

Postby pyhmail » Fri Jul 11, 2008 09:31

then I use the follwing looknfeel to try:

<FrameComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
<Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
<Image type="TopEdge" imageset="TaharezLook" image="WindowTopEdge" />
<Image type="BottonEdge" imageset="TaharezLook" image="WindowBottomEdge" />
<Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal" />
</FrameComponent>

but it does't work still,what should I do?

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

Re: To CrazyEddie:

Postby CrazyEddie » Sat Jul 12, 2008 06:00

I'm going to have a rant. Brace yourself ;)

pyhmail wrote:but it does't work still,what should I do?

If your car breaks down, do you call up a mechanic and say "it does not work, what should I do?" and then expect them to tell you what is wrong, and how to fix it - not only without seeing the car, but also without a description of the problem?

This statement and question is the bane of the support persons life. How is anybody truly, and honestly expected to know why it does not work? What does this statement mean? What does not work? What should you do? Ummm. Give up computing, and take up knitting instead perhaps?



In the XML you posted, this line:

Code: Select all

<Image type="BottonEdge" imageset="TaharezLook" image="WindowBottomEdge" />

the type attribute content is incorrectly spelled, it should be "BottomEdge". I have no idea if this fixes the issue for you, because you did not even bother to describe the issue.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 30 guests