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.

DarkBASIC Discussion / Cool 3D menu system for your projects

Author
Message
HairyCabbage
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: United Kingdom
Posted: 24th Jan 2003 06:28
This is a 3d menu that zooms into the field of view, then when an option is selected it zooms out again.

The only media files used in the program are 2 sound effects included in the Media Library bundled with dark basic, but I`ve commented them out so the program will work as it is..but if you can, put the sound effects back in...its cool.

Features include
1.Changeable Font(the program adjusts to the selected font)
2.Camera position and rotation adjusted to original values, after option is selected.
3.simple to use just assign a view strings


If you use it in your projects give credz to Hairy Cabbage



dim imendat$(20)
autocam off
backdrop on
color backdrop rgb(0,0,0)

sync on
sync rate 50
set current bitmap 0

imendat$(1)="9"
imendat$(2)="Config Data"
imendat$(3)="1..New Game"
imendat$(4)="2..Load Game"
imendat$(5)="3..Save Game"
imendat$(6)="4..Laras House"
imendat$(7)="5..Enter Code"
imendat$(8)="6..Designer"
imendat$(9)="7..Practice"
imendat$(10)="8..Enter Arena"
imendat$(11)="9..Exit"
`imendat$(12)="10th Item"

do
choice=imen()

text 0,0,"choice was option "+str$(choice)
text 0,32,"text..."+imendat$(choice+2)
get image 65533,0,0,200,200
cls
sync

sprite 1,0,0,65533
paste sprite 1,0,0
show sprite 1
sync
sleep 1000


hide sprite 1
` delete image 65533
sync

loop
end

function imen()
rem this is an independant function which is designed to be implemented into
rem any 3d Dark Basic project.

rem Interactive 3D Menu Subsystem
rem written by Hairy Cabbage @ dbforum
rem Developed January 2003
rem changes
` - Preserve camera position
` - commented out "load sound" & "play sound" commands
` (note that these sounds are included in the DB media library)


`load sound "aircraft.wav",1022
`load sound "select.wav",1023

set text font "Comic Sans MS"
set text size 14


`Preserve Camera Position
oldcampx=camera position x()
oldcampy=camera position y()
oldcampz=camera position z()

oldcamax=camera angle x()
oldcamay=camera angle y()
oldcamaz=camera angle z()


tsize=text size()
itemcount=val(imendat$(1))

make object plain 65535,tsize*itemcount,240
hide object 65535

for i=1 to itemcount
ink rgb(i*20+55,0,250),0
text 0,i*tsize,imendat$(i+2)
next i

get image 65535,0,0,tsize*itemcount,240
set current bitmap 0
texture object 65535,65535

position camera 550,100,-1000
point camera 500,100,-1000
position object 65535,200,60,-975
rotate object 65535,90,270,90


`Zoom in
show object 65535
`play sound 1022
i=270
xpos=200
xit1=0
`set text opaque
while xit1=0
inc i,5
if xpos400 and wrapvalue(i)=270 then xit1=1
position object 65535,xpos,60,-975
rotate object 65535,0,wrapvalue(i),0
sync
endwhile

`get user choice.
valid=0
while valid=0
for i=1 to itemcount
a$=inkey$()
if a$=str$(i) then valid=i
next i
endwhile
`play sound 1023


`Zoom Out
xit1=0
while xit1=0
dec i,3
if xpos>-200 then dec xpos,5
if xpos
Where is the Messiah?
HairyCabbage
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: United Kingdom
Posted: 24th Jan 2003 06:30


Where is the Messiah?

Login to post a reply

Server time is: 2024-05-05 03:46:54
Your offset time is: 2024-05-05 03:46:54