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.

Code Snippets / 3d File Browser for DarkBasic (Not Pro Version)

Author
Message
Neodelito
19
Years of Service
User Offline
Joined: 29th Jul 2005
Location:
Posted: 27th Feb 2006 17:21
i make this 3d file browser in dark basic (not pro).. please considere the desing like a model.. they no use any models, only textures and box and spheres.. but they can skined and use your own .x models .. only chage variables skin=0 for skin=1
i hope you like it...


download here full 3d Version:
http://neodelito.webcindario.com/neodelito/e107_files/public/USERID_browser2.rar

and a simple version here:
http://neodelito.webcindario.com/neodelito/e107_files/public/USERID_browser.rar

Attachments

Login to view attachments
Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 27th Feb 2006 18:06 Edited at: 27th Feb 2006 18:06
What's the source for it? Even tho i haven't downloaded anything yet

Neodelito
19
Years of Service
User Offline
Joined: 29th Jul 2005
Location:
Posted: 27th Feb 2006 18:44 Edited at: 27th Feb 2006 18:45
in the download are the full version, code, ... they need graphics..
but the are code..

________________________
rem Name of Code : L.C.B.M.J.

set text font "arial"

skin=0
base$=get dir$()
zfile$=base$+"\skins\uno\file.x"
zfolder$=base$+"\skins\uno\folder.x"
zup$=base$+"\skins\uno\up.x"
print zfile$


load image "folder.bmp",1
sprite 1,10,10,1
load image "file.bmp",2
sprite 2,10,10,2
load image "up.bmp",3
sprite 3,10,10,3

load image "ifolder.bmp",4
load image "ifile.bmp",5
load image "iup.bmp",6


load image "mira.bmp",10
sprite 10,10,10,10
load image "logo.bmp",20
sprite 20,10,10,20

load image "back.bmp",1001
make object sphere 1001,300
texture object 1001,1001
set object 1001,1,0,0,1

load music "fondo.mid",1
load sound "select.wav",1

dim archivos$(10000)
dim carpetas$(10000)
dim archivo$(10000)
dim carpeta$(10000)
dim tipo$(10000)
mydir$=get dir$()
hide mouse
rem el directorio actual se puede cambiar
set dir "c:\"
ini=1
goto refrescar
inicio:
inicio2:
inic#=1
finc#=10
aini#=1
afin#=10
esf=10
y#=10
set camera range 3,300
loop music 1



sync on
do
sprite 10,300,200,10
sprite 20,450,0,20
am#=am#+1
if am#>360 then am#=0
rotate object 1001,am#,am#,am#
rem Usa MOUSEMOVE para cambiar los ángulos de la cámara
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())

if leftkey()=1 then cy#=cy#-2
if rightkey()=1 then cy#=cy#+2
if shiftkey()=1 then y#=y#+1
if controlkey()=1 then y#=y#-1
if cy#>360 then cy#=0
if cy#<0 then cy#=360
if upkey()=1 then cmz#=cmz#+0.5
if cmz#>2 then cmz#=2
if downkey()=1 then cmz#=cmz#-0.5
if cmz#<-2 then cmz#=-2
x#=camera position x()
y#=camera position y()
z#=camera position z()

position camera x#,y#,z#
position object 1001,x#,y#,z#
rotate camera cx#,cy#,cz#
move camera cmz#

seleccion=0
hide sprite 1
hide sprite 2
hide sprite 3

for t=1 to obj

if object visible(t)=0 then t=t+1:if t>obj then t=obj

ox=object position x(t)
oy=object position y(t)
oz=object position z(t)
sx#=object screen x(t)
sy#=object screen y(t)

if object in screen(t)=1
set cursor sx#,sy#
center text sx#,sy#,archivo$(t)
endif

if sx#>300 and sx#<340 and sy#>220 and sy#<260
seleccion=1
objeto=t
target$=archivo$(t)
if tipo$(t)="carpeta" and archivo$(t)<>".."
show sprite 1
sprite 1,sx#,sy#+2,1
endif
if tipo$(t)="archivo"
show sprite 2
sprite 2,sx#,sy#+2,2
endif
if archivo$(t)=".."
show sprite 3
sprite 3,sx#,sy#+2,3
endif

if mouseclick()=1 and tipo$(t)="carpeta"
refrescar=1
click=1
endif

if returnkey()=1 and tipo$(t)="carpeta"
refrescar=1
click=1
endif

endif
next t
if seleccion=1
if sound playing(1)=0 then play sound 1
rs#=rs#+5
if rs#>360 then rs#=1
rotate object objeto,0,rs#,0
endif
if click=1 then goto refrescar
inicio4:

motor:

sync
loop



goto refrescar

refrescar:
click=0
seleccion=0
if refrescar=1
refrescar=0
set dir target$
endif


Archivos:
sync on

undim archivo$(1000)
undim tipo$(1000)

dim archivo$(1000)
dim tipo$(1000)

for t=1 to 1000
if object exist(t)=1
delete object t
endif
next t

obj=0
zdeepc=0
find first
rem Crea matriz y variable de índice
narchivos=1
rem comienza a repetir el bucle
repeat
rem añade al la matriz si se encuentra el fichero
if get file type()=0
obj=obj+1
archivo$(obj)=get file name$()
tipo$(obj)="archivo"
zdeepc=zdeepc+10
if skin=1 then load object zfile$,obj
if skin=0 then make object sphere obj,2
texture object obj,5
ghost object on obj
position object obj,5,-5,zdeepc
endif
rem Encuentra siguiente fichero en el directorio en uso
find next
Rem Repite bucle hasta que no haya más ficheros en el directorio en uso
until get file type()=-1

Carpetas:
zdeepc=0
find first
rem Crea matriz y variable de índice
ncarpetas=1
rem comienza a repetir el bucle
repeat
rem añade al la matriz si se encuentra el fichero
if get file type()=1
obj=obj+1
archivo$(obj)=get file name$()
tipo$(obj)="carpeta"
zdeepc=zdeepc+10
if skin=1 then load object zfolder$,obj
if skin=0 then make object cube obj,3
if archivo$(obj)=".." then texture object obj,6
if archivo$(obj)<>".." then texture object obj,4

ghost object on obj
position object obj,-5,0,zdeepc

endif
rem Encuentra siguiente fichero en el directorio en uso
find next
Rem Repite bucle hasta que no haya más ficheros en el directorio en uso
until get file type()=-1

position camera 0,20,0
sync
if ini=1 then ini=0:goto inicio

goto motor

rem Programa creado po Jaime A. Zegpi badilla
rem Jaimezegpi@yahoo.es
rem http.//neodelito.webcindario.com
rem N E O D E L I T O
_____________________________

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 27th Feb 2006 20:33
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 28th Feb 2006 03:19
It's a bit cleaner to use


Mysteries Surround You

Login to post a reply

Server time is: 2024-11-23 07:04:31
Your offset time is: 2024-11-23 07:04:31