 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
stonerifik
Joined: 15 Aug 2005 Posts: 3
|
Posted: Tue Aug 23, 2005 1:37 pm Post subject: Creating a working rollover image. |
|
|
Hello all, I have been browsing around the forums and I am very impressed, although I am not quite upto your level in the Lua programming, I am striving to get better. Anyways heres what I need some help with.
I have a start menu for my game with the options: Play Now, Settings, Credits.
I am using this code to display my pictures:
| Code: |
screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
screen:blit(300,75, menu1img)
screen:blit(300,125, menu2img)
screen:blit(300,175, menu3img)
|
What I would like to learn is how to make use of the d-pad with the UP and DOWN arrows to select these images and call another image to act as a rollover image...
That is it for now, any help or reference to something like this would be very much appriciated. Thank you for your time.
- stonerifik |
|
| Back to top |
|
 |
0x0001

Joined: 21 Jul 2005 Posts: 11
|
Posted: Tue Aug 23, 2005 2:51 pm Post subject: |
|
|
this belongs in the lua player
forum please do post in the right
forum ...as would reduce confusion
and clutter and more lua specific
devs coud help you out more in
that forum |
|
| Back to top |
|
 |
stonerifik
Joined: 15 Aug 2005 Posts: 3
|
Posted: Tue Aug 23, 2005 2:54 pm Post subject: |
|
|
| Oh my bad, :P I apologize, could anyone move this post? |
|
| Back to top |
|
 |
Oobles Site Admin
Joined: 17 Jan 2004 Posts: 362 Location: Melbourne, Australia
|
Posted: Tue Aug 23, 2005 3:49 pm Post subject: |
|
|
| Moved. |
|
| Back to top |
|
 |
nevyn
Joined: 31 Jul 2005 Posts: 136 Location: Sweden
|
Posted: Tue Aug 23, 2005 6:02 pm Post subject: Re: Creating a working rollover image. |
|
|
| stonerifik wrote: | Hello all, I have been browsing around the forums and I am very impressed, although I am not quite upto your level in the Lua programming, I am striving to get better. Anyways heres what I need some help with.
I have a start menu for my game with the options: Play Now, Settings, Credits.
I am using this code to display my pictures:
| Code: |
screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
screen:blit(300,75, menu1img)
screen:blit(300,125, menu2img)
screen:blit(300,175, menu3img)
|
What I would like to learn is how to make use of the d-pad with the UP and DOWN arrows to select these images and call another image to act as a rollover image...
That is it for now, any help or reference to something like this would be very much appriciated. Thank you for your time.
- stonerifik |
I do this in Lowser. It's pretty simple: use a number variable as an index for the currently selected item. When down is pressed, increase the index, and opposite for up. In the blit section, blit the overlay image according to the index;
| Code: | | screen:blit(300,75+50*menuIndex, menuOverlayimg) |
|
|
| Back to top |
|
 |
stonerifik
Joined: 15 Aug 2005 Posts: 3
|
Posted: Wed Aug 24, 2005 8:15 am Post subject: |
|
|
| Quote: | | use a number variable as an index for the currently selected item. |
How would I do that? Sorry if this is a stupid question, I will keep searching. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|