Select image [mouse event]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
darko024
Posts: 9
Joined: Tue Mar 14, 2006 2:45 am

Select image [mouse event]

Post by darko024 »

need help with this :

I have images array

Code: Select all

IGUIImage* p[9][9];
which set like this

Code: Select all

for(int i = 1; i <=8; i++) {
        for(int b = 1; b <=8; b++) {
                p[i][b] = guienv->addImage(empty,position2d<int>((i*50)-50,(b*50)-50));
                }

        }
and if I click on one image i want to get something like this p[1][3] is select ...

-------
thx
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

Give your images IDs with setID(). This could be something like i*8+b.
You should then be able to get the ID with event.GUIEvent.Caller->getID() in your receiver method.
Post Reply