diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-10-10 01:08:18 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-10-10 01:08:18 +0000 |
commit | 6e0bcb9499486bd42ceca53c52092534f36a9647 (patch) | |
tree | 52b5ef7c6bce74b025d4342d22475d649283a5d8 | |
parent | abdcb79b14bb9ff187f6a1fa9258c8bc8afcdbd2 (diff) |
*** empty log message ***
-rw-r--r-- | vectorgfx/.cvsignore | 2 | ||||
-rw-r--r-- | vectorgfx/obj1.2d | bin | 0 -> 144 bytes | |||
-rw-r--r-- | vectorgfx/obj2.2d | bin | 0 -> 144 bytes | |||
-rw-r--r-- | vectorgfx/test.bmx | 74 |
4 files changed, 76 insertions, 0 deletions
diff --git a/vectorgfx/.cvsignore b/vectorgfx/.cvsignore new file mode 100644 index 0000000..8f686ea --- /dev/null +++ b/vectorgfx/.cvsignore @@ -0,0 +1,2 @@ +test.debug.exe
+.bmx
\ No newline at end of file diff --git a/vectorgfx/obj1.2d b/vectorgfx/obj1.2d Binary files differnew file mode 100644 index 0000000..f80ae2d --- /dev/null +++ b/vectorgfx/obj1.2d diff --git a/vectorgfx/obj2.2d b/vectorgfx/obj2.2d Binary files differnew file mode 100644 index 0000000..4f90927 --- /dev/null +++ b/vectorgfx/obj2.2d diff --git a/vectorgfx/test.bmx b/vectorgfx/test.bmx new file mode 100644 index 0000000..cbe1f64 --- /dev/null +++ b/vectorgfx/test.bmx @@ -0,0 +1,74 @@ +' $Id$ + +Import noddybox.vectorgfx +Strict + +Const SCRW=800'1280 +Const SCRH=600'1024 + +SetGraphicsDriver GLMax2DDriver() +Graphics SCRW,SCRH,32,60' Or HARDSYNC +'HideMouse() + +SetBlend(ALPHABLEND) + +Const SIZE:Int=20 +Const MSIZE:Int=40 + +'Local o1:TVectorGfxObject=New TVectorGfxObject +'Local o2:TVectorGfxObject=New TVectorGfxObject + +Local o1:TVectorGfxObject=TVectorGfxObject.Load("obj1.2d") +Local o2:TVectorGfxObject=TVectorGfxObject.Load("obj2.2d") + +Local cm:TVectorGfxCollisionMap=TVectorGfxCollisionMap.Create(MSIZE,MSIZE) + +Rem +o1.AddLine(TVectorGfxLine.Create(-SIZE,SIZE,SIZE,SIZE,255,0,0,1)) +o1.AddLine(TVectorGfxLine.Create(SIZE,SIZE,SIZE,-SIZE,0,255,0,2)) +o1.AddLine(TVectorGfxLine.Create(SIZE,-SIZE,-SIZE,-SIZE,255,0,0,1)) +o1.AddLine(TVectorGfxLine.Create(-SIZE,-SIZE,-SIZE,SIZE,0,255,0,2)) +o1.x=400 +o1.y=300 +o1.Save("obj1.2d") + +o2.AddLine(TVectorGfxLine.Create(-SIZE,SIZE/2,SIZE,SIZE/2,255,255,255,0)) +o2.AddLine(TVectorGfxLine.Create(SIZE,SIZE/2,SIZE,-SIZE/2,255,255,255,0)) +o2.AddLine(TVectorGfxLine.Create(SIZE,-SIZE/2,-SIZE,-SIZE/2,255,255,255,0)) +o2.AddLine(TVectorGfxLine.Create(-SIZE,-SIZE/2,-SIZE,SIZE/2,255,255,255,0)) +o2.Save("obj2.2d") +EndRem + +While Not KeyHit(KEY_ESCAPE) + Cls + + cm.Clear() + cm.SetOffset(MouseX()-MSIZE/2,MouseY()-MSIZE/2) + + If KeyHit(KEY_F1) + VectorGfxSetSolid() + EndIf + + If KeyHit(KEY_F2) + VectorGfxSetAlpha(0.7,1.0) + EndIf + + If KeyHit(KEY_F3) + VectorGfxSetThickAlpha(0.2) + EndIf + + o1.Draw(cm) + o1.ang=(o1.ang+2) Mod 3600 + + o2.x=MouseX() + o2.y=MouseY() + o2.Draw(cm) + + DrawText MilliSecs() + ":Col=" + o2.Draw(cm),0,0 + + Flip + FlushMem +Wend + +EndGraphics +End |