LuaDrawing.wiki
changeset 256 0b93b3ec3ebf
parent 255 18e1a94e1591
child 257 3d03892b7545
--- a/LuaDrawing.wiki	Fri Oct 19 21:00:58 2012 +0000
+++ b/LuaDrawing.wiki	Fri Oct 19 21:10:21 2012 +0000
@@ -10,9 +10,9 @@
 First, a couple of convenience functions for drawing to the map.
 <code lang="lua">
 PointsBuffer = ''  -- A string to accumulate points in
-function AddPoint(x, y, new, size, erase)
+function AddPoint(x, y, size, erase)
     PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
-    if new then
+    if size then
         size = bor(size,0x80)
         if erase then
             size = bor(size,0x40)
@@ -33,7 +33,7 @@
     end
 end
 </code>
-AddPoint takes an x and y location for the point, 2 booleans: new (start of a line or not), erase (whether the line is erasing from the map) and size (size of the line - a value from 1 to 63)
+AddPoint takes an x and y location for the point, a size (required to start a line) and erase (whether the line is erasing from the map)
 FlushPoints writes out any values from PointsBuffer that had not already been sent to the engine.  It would be called at the end of a drawing session.
 
 A simple example below.
@@ -43,25 +43,25 @@
     MapGen = 2
     TemplateFilter = 0
 
-    AddPoint(100,100,true,10)
+    AddPoint(100,100,10)
     AddPoint(2000,2000)
-    AddPoint(2000,100,true,10)
+    AddPoint(2000,100,10)
     AddPoint(100,2000)
-    AddPoint(1000,1000,true,63,true)
+    AddPoint(1000,1000,63,true)
 
     for i = 63,2,-4 do
-    AddPoint(2000,1000,true,i)
-    AddPoint(2000,1000,true,i-2,true)
+        AddPoint(2000,1000,i)
+        AddPoint(2000,1000,i-2,true)
     end
 
     for i = 1,2000,50 do
-    AddPoint(i+2000,2000,true,1)
-    AddPoint(4000,2000-i)
+        AddPoint(i+2000,2000,1)
+        AddPoint(4000,2000-i)
     end
 
-    AddPoint(2000,2000,true,1)
+    AddPoint(2000,2000,1)
     AddPoint(4000,2000)
-    AddPoint(4000,0,true,1)
+    AddPoint(4000,0,1)
     AddPoint(4000,2000)
 
     FlushPoints()