Creating a working rollover image.

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
stonerifik
Posts: 3
Joined: Mon Aug 15, 2005 2:11 pm

Creating a working rollover image.

Post by stonerifik »

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: Select all

   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
User avatar
0x0001
Posts: 11
Joined: Thu Jul 21, 2005 10:02 am

Post by 0x0001 »

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
stonerifik
Posts: 3
Joined: Mon Aug 15, 2005 2:11 pm

Post by stonerifik »

Oh my bad, :P I apologize, could anyone move this post?
Oobles
Site Admin
Posts: 347
Joined: Sat Jan 17, 2004 9:49 am
Location: Melbourne, Australia
Contact:

Post by Oobles »

Moved.
nevyn
Posts: 136
Joined: Sun Jul 31, 2005 5:05 pm
Location: Sweden
Contact:

Re: Creating a working rollover image.

Post by nevyn »

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: Select all

   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: Select all

screen:blit(300,75+50*menuIndex, menuOverlayimg)
stonerifik
Posts: 3
Joined: Mon Aug 15, 2005 2:11 pm

Post by stonerifik »

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.
Post Reply