News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Fun With Copy Bitmap

Started by kevin, May 21, 2003, 06:58:58 PM

Previous topic - Next topic

kevin

Here's a little fun with DB classic's copy bitmap command.  Dunno if it works in DBpro or not..





Sync on
Sync rate 0

ScreenWidth=640
ScreenHeight=380
screenwidth2=screenwidth-1
screenheight2=screenheight-1

x=ScreenWidth/2

Do


String$="Fun With Copy Bitmap"


ink rgb(rnd(255),rnd(255),rnd(255)),0
 text x,200,String$
 dec x
 if x<(text width(String$)*-1) then x=screenwidth

 copy bitmap 0,0,8,screenwidth2,screenheight2,0,0,0,screenwidth2,screenheight

ink rgb(255,255,255),0
text x,200,string$

sync

loop


BinaryMoon

I think this is the same... my blitz version :)


Graphics 640,480,16,2
SetBuffer BackBuffer()

x=GraphicsWidth()
tString$="Fun with copyrect"

Repeat

Color Rand(255),Rand(255),Rand(255)
Text x,200,tString
x=x-1
If x<-StringWidth(tString) x=GraphicsWidth()

CopyRect 0,8,GraphicsWidth()-1,380,0,0,BackBuffer(),FrontBuffer()

Flip

Until KeyHit(1)

End


I've edited it to make it a bit closer. Its the stretching I'm having trouble with though.
Ben aka Mop

BinaryMoon
BinarySun

kevin

yeah, it's missing the strechy/scaling effect though..

BinaryMoon

I didn't try the DB version so didn't know how it should look.

I must admit I thought it looked a bit tame for a 'fun' snippet :) Just tried it in DB and can see what is supposed to happen. Can't think of an easy way to do this though...
Ben aka Mop

BinaryMoon
BinarySun

kevin

Yeah months of works went into that one :).. The sort of thing i couldn't be stuffed ever uploading to the site

Just crashes in DbPro4.1..