This is sprite menu for character generation for a 3d RPG I am working on. The graphics were made with photoshop. It's not yet complete, but nearly there.
Is there a more efficient method for doing what I have done here?
Here is the code:
`Realms of Adventure Menu Char_Gen Screen
`by Jason Keyes
`10/06/06
set display mode 800,600,32
Co=RGB(240,255,35):ink co,1
sync rate 0
sync on
`rem
`place text images and break into buttons
`*****************
`gender buttons
load image "button_gender_sel_225x111_001.png",1,1
paste image 1,0,0
for y=0 to 2
x = 0
GET IMAGE (y+10),x,y*37,225,((y*37)+37)
SPRITE (y+1),x,(y*37),1
next y
delete image 1
`**************
`race buttons
load image "button_race_sel_225x148_001.png",1,1
paste image 1,0,0
for y=3 to 6
get image (y+10),x,(y-3)*37,225,(((y-3)*37)+37)
sprite (y+1),x,((y-3)*37),1
next y
delete image 1
`****************
`school buttons
load image "button_school_sels_225x259.png",1,1
paste image 1,0,0
for y=7 to 13
get image (y+10),x,(y-7)*37,225,(((y-7)*37)+37)
sprite (y+1),x,((y-7)*37),1
next y
delete image 1
`load Toon Images
` ************Dwarf
load image "Geo_Dwarf.png",1,1
paste image 1,0,0
get image 99,0,0,160,212
sprite 99,1,1,99
delete image 1
`*************Elf
load image "Geo_Elf.png",1,1
paste image 1,0,0
get image 98,0,0,117,238
sprite 98,1,1,98
delete image 1
`*************Human
load image "Geo_Human.png",1,1
paste image 1,0,0
get image 97,0,0,144,250
sprite 97,1,1,97
delete image 1
`load gauntlet Icon
load image "gauntlet_icon20X35.png",1,1
paste image 1,0,0
get image 101,0,0,34,19
sprite 101,1,1,101
delete image 1
`load sword icon
load image "sword_icon_small_50x15.png",1,1
paste image 1,0,0
get image 102,0,0,49,14
sprite 102,1,1,102
get image 103,0,0,49,14
sprite 103,1,1,103
get image 104,0,0,49,14
sprite 104,1,1,104
delete image 1
for hidden=101 to 104
set sprite alpha hidden,0
next hidden
load image "char_create_003_800x600bkg.png",2,1
`*****************main loop****************************************************
do
cls
mx=mousex()
my=mousey()
paste image 2,0,0
`paste button sprites------gender @x45,y460
for z=0 to 2
sprite z+1,45,(z*40)+456,(z+10)
set sprite alpha z+1,150
next z
`-------------race @x50,y105
for z=3 to 6
sprite z+1,50,((z-3)*41)+98,(z+10)
set sprite alpha z+1,150
next z
`-------------school @x305,y18
for z=7 to 13
sprite z+1,305,((z-7)*38)+10,(z+10)
set sprite alpha z+1,150
next z
if toonpic=1
sprite 99,335,340,99
set sprite alpha 99,255
endif
if toonpic<>1 then set sprite alpha 99,0
if toonpic=2
sprite 98,355,330,98
set sprite alpha 98,255
endif
if toonpic<>2 then set sprite alpha 98,0
if toonpic=3
sprite 97,340,320,97
set sprite alpha 97,255
endif
if toonpic<>3 then set sprite alpha 97,0
`Sequence for Left Column Buttons-------------------------
if mx>250 and mx<300 then set sprite alpha 101,0
if mx>50 and mx<250
`if user clicks on race selection
if my>98 and my<255 then set sprite alpha 4,255
if my<98 or my>255 then set sprite alpha 101,0
`Dwarf Button
if my>140 and my<177
set sprite alpha 5,255
`place icon next to selection
sprite 101,50,145,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 102,45,150,102
set sprite alpha 102,255
toonpic=1
endif
if toonpic=1 then set sprite alpha 101,0
endif
`Elf Button
if my>183 and my<217
set sprite alpha 6,255
`place icon next to selection
sprite 101,50,188,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 102,45,193,102
set sprite alpha 102,255
toonpic=2
endif
if toonpic=2 then set sprite alpha 101,0
endif
`Human Button
if my>221 and my<255
set sprite alpha 7,255
`place icon next to selection
sprite 101,50,226,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 102,45,231,102
set sprite alpha 102,255
toonpic=3
endif
if toonpic=3 then set sprite alpha 101,0
endif
`if user clicks on gender selection
if my>458 and my<570 then set sprite alpha 1,255
`female
if my>499 and my<532
set sprite alpha 2,255
sprite 101,50,504,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 103,45,509,103
set sprite alpha 103,255
toongender=1
endif
if toongender=1 then set sprite alpha 101,0
endif
`male
if my>538 and my<570
set sprite alpha 3,255
sprite 101,50,543,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 103,45,548,103
set sprite alpha 103,255
toongender=2
endif
if toongender=2 then set sprite alpha 101,0
endif
endif
`Beginning of Sequence for Center Column Buttons---------------------------------
if mx<300 and mx>250 then set sprite alpha 101,0
if mx>300 and mx<520
`if user clicks on school selection
if my>10 and my<272 then set sprite alpha 8,255
`School of Deception-----------------------------------------------
if my>47 and my<77
set sprite alpha 9,255
sprite 101,305,53,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 104,300,58,104
set sprite alpha 104,255
toonclass=1
endif
if toonclass=1 then set sprite alpha 101,0
endif
`School of Fighter--------------------------------------------------
if my>87 and my<115
set sprite alpha 10,255
sprite 101,305,93,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 104,300,98,104
set sprite alpha 104,255
toonclass=2
endif
if toonclass=2 then set sprite alpha 101,0
endif
`School of Healing----------------------------------------------------
if my>127 and my<153
set sprite alpha 11,255
sprite 101,305,133,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 104,300,138,104
set sprite alpha 104,255
toonclass=3
endif
if toonclass=3 then set sprite alpha 101,0
endif
`School of Hunting-----------------------------------------------------
if my>164 and my<194
set sprite alpha 12,255
sprite 101,305,170,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 104,300,175,104
set sprite alpha 104,255
toonclass=4
endif
if toonclass=4 then set sprite alpha 101,0
endif
`School of Magic--------------------------------------------------------
if my>202 and my<232
set sprite alpha 13,255
sprite 101,305,207,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 104,300,212,104
set sprite alpha 104,255
toonclass=5
endif
if toonclass=5 then set sprite alpha 101,0
endif
`School of Music---------------------------------------------------------
if my>241 and my<272
set sprite alpha 14,255
sprite 101,305,246,101
set sprite alpha 101,255
if mouseclick()=1
`place chosen icon next to selection
sprite 104,300,251,104
set sprite alpha 104,255
toonclass=6
endif
if toonclass=6 then set sprite alpha 101,0
endif
endif
text 1,1,"mx="+str$(mx)
text 1,12,"my="+str$(my)
sync
loop
And here is a link to a very low rez image screen shot:
http://unitedchaos.i8.com
I am alos including the media, which you can put in the folder with the code; in case anyone wants to run it and see how it really looks
Any feedback is appreciated.
J