Da_Zippa,
Below is source of a method to create a 2D starfield using individual sprite images. I have attached to this post the folder containing the images used, along with the .dba file to run. The stars' backgrounds are not completely transparent, because the fact that I used compressed .jpg images. However, the images can be edited. Enjoy.
set display mode 800,600,32
sync on
sync rate 60
hide mouse
REM << load star images
load image "star1.jpg",1
load image "star2.jpg",2
load image "star3.jpg",3
REM << make an array for sprites(5 dimensions;dim1=img#,dim2=imgwidth,dim3=xcoord,dim4=ycoord,dim5=travelspd)
dim stars(100,5)
REM << REM create sprite images from loaded images;give them random image#,start location and travel speed;get and store width of used image
for t = 1 to 100
REM << choose random image
stars(t,1) = 1 + rnd(2)
REM << get random start position
stars(t,3) = rnd(800)
stars(t,4) = rnd(600)
REM << get random, but limited travel speed;make minimum speed to be 2 pixels per loop;maximum 5 pixels
stars(t,5) = 2 + rnd(3)
REM << create sprite and then store sprite width for screen wrapping referance
sprite t,stars(t,3),stars(t,4),stars(t,1)
stars(t,2) = sprite width(t)
next t
REM <<<<<<<<< main loop >>>>>>>>>>
repeat
REM << make stars move across screen from left to right;make them to wrap around the screen
for t = 1 to 100
REM << make the star move left at its stored travel speed
stars(t,3) = stars(t,3) - stars(t,5)
REM << if star leaves left side of screen completeley(here is where we make use of the width of the image)then wrap it to the right side of the screen
if stars(t,3) < 0 - stars(t,2) then stars(t,3) = 800 + stars(t,2)
REM << update sprite displacement
sprite t,stars(t,3),stars(t,4),stars(t,1)
next t
sync
until mouseclick() = 1
undim stars(100)
end
+NanoBrain+