[SOLVED] Mouse cursor stopped working

brick

05-03-2009 16:03:33

I just updated to the svn head (trunk), and now the mouse cursor is no longer visible. My xml file looks like this:

<MyGUI type="Pointer">
<Pointer layer="Pointer" texture="mwpointer.png" default="arrow">
<Info name="arrow" point="7 0" size="32 32" offset="0 0 32 32"/>
<Info name="hresize" point="16 14" size="32 32" offset="32 0 32 32"/>
<Info name="vresize" point="17 16" size="32 32" offset="0 32 32 32"/>
<Info name="dresize" point="17 15" size="32 32" offset="32 32 32 32"/>
<Info name="dresize2" point="15 15" size="32 32" offset="64 32 32 32"/>
</Pointer>
</MyGUI>


Browsing through the demo code in the new revision, I saw some XML files that used resource="something", with the corresponding "something" being in another file. But I don't really understand how this works (and couldn't get it to work myself.) I just want to use cursors from one single image, using offset like above, how do I do this? Do I have to use the resource attribute, and if so could someone help me ? Thanks.

Five_stars

06-03-2009 18:11:47

I'll try to do it - and I think get a results.

in core_pointer.xml
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Pointer">
<Pointer layer="Pointer" texture="core_pointer.png" default="arrow">
<Info name="arrow" point="1 1" size="32 32" resource="pic_CorePointerArrow"/>
<Info name="beam" point="16 16" size="32 32" resource="pic_CorePointerArrow"/>
<Info name="hand" point="16 16" size="32 32" resource="pic_CorePointerArrow"/>
</Pointer>
</MyGUI>

There you can add or delete your Info tags.

in core_resource.xml
I've changed <Resource type="ResourceImageSet" name="pic_CorePointerArrow" id="{C7ECFCE4-6021-4628-9BFF-1F36D594D7CB}"> tags to
<Resource type="ResourceImageSet" name="pic_CorePointerArrow" id="{C7ECFCE4-6021-4628-9BFF-1F36D594D7CB}">
<Group name="Pointer" texture="core_pointer.png" size="32 32">
<Index name="Pointer">
<Frame point="13 11"/>
</Index>
</Group>
</Resource>

<Frame point="13 11"/> - is offset in texture - set your
I use original core_pointer.png

I hope it'll help.

brick

06-03-2009 20:03:11

Ok, thank you, I will try this.

Does the id="{...}" have any meaning, btw? And is there any reason why this was changed to become more complicated? (just asking because I'm curious.)

Five_stars

07-03-2009 06:39:24

As I know, it was done for more functionality.
For example, you can store in one image file many icons or may be one icon in different sizes.

About id. I quote Altren (from here): We using it for creating identifiers for all images used in gui, because sometimes that can have no name or two pictures with same name or for pictures created in code.

my.name

08-03-2009 11:17:35

fixed, update from svn, revision 1796

brick

08-03-2009 18:17:11

fixed, update from svn, revision 1796
Thank you, it works now! You rock :)