Change mouse Image

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

gangste85
Just popping in
Just popping in
Posts: 3
Joined: Sat Feb 09, 2008 22:12

Change mouse Image

Postby gangste85 » Sat Feb 09, 2008 22:26

I am working on a program...

I want to change the MouseCursor, i can change it, but i also need to change it with a value from a .txt message so the user can customise.

string fromtxtfile;
CEGUI::String valuefromtxtfile = fromtxtfile;
CEGUI::MouseCursor::getSingleton().setImage("LevelLook", valuefromtxtfile);

I have mad al the value's in the txt file available in the levellook.schem and levellook.imageset. If i use hard code like .setImage("LevelLook", "MouseEnemy"); it works fine.

Can anyone tell me what i am doing wrong..

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

Postby CrazyEddie » Sun Feb 10, 2008 07:54

Hi, and welcome to the forum :)

It certainly looks like it should work. Can you look in the CEGUI.log file and see if there are any errors.

The only other thing that comes to mind at the moment is that it could be a character encoding issue - whether this is the case or not will depend on whether you use characters with code >127, and if so, how you subsequently assign those to the string object.

Anyhow, for now just look in the log and see if there are errors relating to images :)

CE.

gangste85
Just popping in
Just popping in
Posts: 3
Joined: Sat Feb 09, 2008 22:12

Postby gangste85 » Sun Feb 10, 2008 11:11

Hi,

i am getting this error

(Error) Exception: Imageset::getImage - The Image named '' could not be found in Imageset 'LevelLook'.

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 » Sun Feb 10, 2008 11:36

Looks like you're passing a non-ascii character or something (like CE suggested). Are you sure that your txt file loader is working correctly? You can dump the loaded settings with calls to CEGUI::Logger::getSingleton().logEvent(...).

HTH!
Last edited by scriptkid on Sun Feb 10, 2008 11:38, edited 1 time in total.
Check out my released snake game using Cegui!

gangste85
Just popping in
Just popping in
Posts: 3
Joined: Sat Feb 09, 2008 22:12

Postby gangste85 » Sun Feb 10, 2008 11:37

After seeing the log is started looking to the input from the txt file and i converted the input on the wrong way so that the string all ready had the wrong value...

my mistake :oops:

thnks anyway..

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 » Sun Feb 10, 2008 11:39

Okay np :)
Check out my released snake game using Cegui!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 23 guests