Create Custom Image 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

Duke
Just popping in
Just popping in
Posts: 2
Joined: Sun Feb 04, 2007 17:47

Create Custom Image Button

Postby Duke » Tue Mar 13, 2007 02:21

Hi,
I'm currently trying to create a custom looking button with CEGUI (which has the latest version 0.5.0 of CEGUI). I'm using the current version of Delta3D. Now i followed the tutorials given in the CEGUI Wiki, but my button still shows up like a normal button, and i get the following errors in the log file:

Code: Select all

09/03/2007 15:58:19 (Error)    Exception: There is no Property named 'NormalImage' available in the set.
09/03/2007 15:58:19 (Error)    Exception: There is no Property named 'HoverImage' available in the set.
09/03/2007 15:58:19 (Error)    Exception: There is no Property named 'PushedImage' available in the set.
09/03/2007 15:58:19 (Error)    Exception: There is no Property named 'DisabledImage' available in the set.


If these are not the valid properties to setup in order to change the images. What are they ???

Here's my .imageset file

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<Imageset Name="ToolIcon1" Imagefile="imagesets/tool1.tga" AutoScaled="true">
    <Image Name="ButtonUp" XPos="0" YPos="0"  Width="149" Height="42" />
    <Image Name="ButtonHighlighted"  XPos="0" YPos="42" Width="149" Height="42" />
    <Image Name="ButtonDown" XPos="0" YPos="84" Width="149" Height="42" />
    <Image Name="ButtonDisabled" XPos="0" YPos="126" Width="149" Height="42" />
</Imageset>


And here is the .layout file

Code: Select all

 
...
<Window Type="WindowsLook/Button" Name="Menu/Button1" >
    <Property Name="DisabledTextColour" Value="FF888888" />             
    <Property Name="HoverTextColour" Value="FF000000" />
    <Property Name="MouseCursorImage" Value="set:WindowsLook image:MouseArrow" />
    <Property Name="NormalTextColour" Value="FF000000" />
    <Property Name="PushedTextColour" Value="FF000000" />
    <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
    <Property Name="UnifiedSize" Value="{{0,149},{0,42}}" />
   
    <Property Name="NormalImage" Value="set:ToolIcon1 image:ButtonUp" />
    <Property Name="HoverImage" Value="set:ToolIcon1 image:ButtonHighlighted" />
    <Property Name="PushedImage" Value="set:ToolIcon1 image:ButtonDown" />
    <Property Name="DisabledImage" Value="set:ToolIcon1 image:ButtonDisabled" />

    <Property Name="Tooltip" Value="Button 1"/>
</Window>

...


Note that i am trying to add this button to the content of a Tab Menu. If that matters for some reason.

Thanks

phoenixy
Just popping in
Just popping in
Posts: 14
Joined: Tue Feb 27, 2007 01:18

Postby phoenixy » Tue Mar 13, 2007 18:01

Hi,
there's no such properties in "WindowsLook/Button".
They're property of "TaharezLook/ImageButton" only.

I've copied the code for "ImageButton" from taharezlook.looknfeel to WindowsLook.looknfeel to make it work for "WindowsLook/ImageButton",
but I'm not sure it's correct way to do it.

Anyway, to make the custom image button, you have to use ImageButton.


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 27 guests