Edited wiki page LuaDrawing through web user interface.
--- a/LuaDrawing.wiki Fri Oct 19 21:20:47 2012 +0000
+++ b/LuaDrawing.wiki Fri Oct 19 21:27:25 2012 +0000
@@ -10,7 +10,7 @@
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, size, erase)
+function AddPoint(x, y, width, erase)
PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
if size then
size = bor(size,0x80)
@@ -33,7 +33,7 @@
end
end
</code>
-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). The size is the "width" value from [[DrawnMapFormat]].
+AddPoint takes an x and y location for the point, a width (indicates the start of a new line) and erase (whether the line is erasing from the map). The width calculation is described in [DrawnMapFormat].
FlushPoints writes out any values from PointsBuffer that have not already been sent to the engine.
It would be called at the end of a drawing session.
@@ -82,5 +82,6 @@
for i = 500,3500,1000 do
AddPoint(i,1000,63,true)
end
+ FlushPoints()
</code>
This one fills the map with solid land, and draws 3 circular erased points in it.
\ No newline at end of file