summaryrefslogtreecommitdiff
path: root/vectorgfx.mod/vectorgfx.bmx
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-10-21 02:16:32 +0000
committerIan C <ianc@noddybox.co.uk>2005-10-21 02:16:32 +0000
commitff47afdbca120fc382e9551ff829bc35956092d7 (patch)
treed06c5ce633acbc3ce27a53b17b2976107cfa2dec /vectorgfx.mod/vectorgfx.bmx
parente330b273da5099a7e5e564af90b319bad7e9f8f7 (diff)
Added scale to objects, and ability to clone objects
Diffstat (limited to 'vectorgfx.mod/vectorgfx.bmx')
-rw-r--r--vectorgfx.mod/vectorgfx.bmx24
1 files changed, 22 insertions, 2 deletions
diff --git a/vectorgfx.mod/vectorgfx.bmx b/vectorgfx.mod/vectorgfx.bmx
index 098d9b2..dc84388 100644
--- a/vectorgfx.mod/vectorgfx.bmx
+++ b/vectorgfx.mod/vectorgfx.bmx
@@ -223,7 +223,11 @@ Type TVectorGfxObject
Rem
bbdoc: The angle of the object, as degrees*10. Must be within the range 0-3599 inclusive.
EndRem
- Field ang:Int
+ Field ang:Int
+ Rem
+ bbdoc: The scale of the object.
+ EndRem
+ Field scale:Double
Field rotated:TVectorGfxPoint[]
@@ -238,6 +242,22 @@ Type TVectorGfxObject
x=0
y=0
ang=0
+ scale=1
+ End Method
+
+ Rem
+ bbdoc: Clones this object
+ about: Returns a copy of this object, with its own copy of the line and points.
+ EndRem
+ Method Clone:TVectorGfxObject()
+ Local o:TVectorGfxObject=New TVectorGfxObject
+ o.x=x
+ o.y=y
+ o.ang=ang
+ o.scale=scale
+ o.SetPoints(points)
+ o.SetLines(lines)
+ Return o
End Method
Rem
@@ -374,7 +394,7 @@ Type TVectorGfxObject
rotated=New TVectorGfxPoint[points.length]
For Local f:Int=0 Until points.length
- Local p:TAlgoPoint=DoRotate(points[f].x,points[f].y,ang)
+ Local p:TAlgoPointD=DoRotateD(points[f].x*scale,points[f].y*scale,ang)
rotated[f]=TVectorGfxPoint.Create(p.x,p.y)
Next