Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Mouse Rollover

Author
Message
Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 10th Nov 2009 23:45
I have to write a program that displays an image.When the user moves the user pointer over the images,it should change to a second image.The second image should remain displayed as long as the mouse pointer is over it.When the user moves the mouse pointer away from image,it should change to the first image.
I just need a pseudocode as i'm not understanding how and what to do in this...

goonj
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 11th Nov 2009 00:22
Alright, here ya go

Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 11th Nov 2009 01:22
i made this code... i dont understand how i should use the if else condition in this...

goonj

Attachments

Login to view attachments
Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 11th Nov 2009 01:35
i have added some more into it but i can not see any of the image on output...and not even the hand image

goonj

Attachments

Login to view attachments
Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 11th Nov 2009 01:58
i have made some more changes
but i need to make a program for-when the pointer comes on the image,the image1 should change to image 2 and when i take the pointer off the image2,it should change back to image 1...the one i have done is for click...i need to edit it...can you tell me how

goonj

Attachments

Login to view attachments
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 11th Nov 2009 05:08
what it looks like to me is that you just need to set mouseX and mouseY to the mouse position, which can be accessed with dbMouseX() and dbMouseY().
you should do this at the beginning of the main loop(while(LoopGDK())):


then, you need to just use the onSprite() function, without using the fullClick() function. I haven't compiled it with these changes, but I believe it should work.

Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 11th Nov 2009 05:13
i changed tht..bt when i bring the cursor on the image...the image does not change to the second image...

goonj

Attachments

Login to view attachments
Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 11th Nov 2009 05:16
i omitted the fullclick function from the program...
it jst changes the image 1 to image 2...
i want to change it only when i bring the cursor on the image...

goonj

Attachments

Login to view attachments
Goonj
15
Years of Service
User Offline
Joined: 21st Sep 2009
Location:
Posted: 11th Nov 2009 05:46
can you plz also have a look at this program too.. its a game..called catch the boulder.. i have done evrythng in it.. i just need to fix the cart at the track and drop the rock at different places.plz do have a look and see if you can find the mistake...

goonj

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-20 11:23:27
Your offset time is: 2024-11-20 11:23:27