moai/moai-beta — pull request #34 by joarb (2012-03-26 21:02:27+00:00)
Title: Added lua callable methods for drawing misc. primitives based on an array

I've added method MOAIDraw::DrawLuaArray, similar to MOAIDraw::DrawLuaParams. It can be fed a single array containing all the coordinates of the desired vertices in sequence, like so: { x0, y0, x1, y1, x2, y2, ... , xn, yn }.

In addition, I've "overloaded" fillFan, drawLine, and drawPoints so that they, based on the given input, decide wether to call the established MOAIDraw::DrawLuaParams or its array-based cousin MOAIDraw::DrawLuaArray. I'm not sure if this is the preferred way to do it - maybe its not the "MOAI"-way.

On a side note, I've got to mention that I haven't tested this code with 1.0, but it works like a charm in 0.95.