finished documentation

git-svn-id: svn://anubis/anaglym/trunk@196 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-11-25 01:15:55 +00:00
parent 07d2ceb9c0
commit 8ea89aea33
2 changed files with 65 additions and 0 deletions

3
ag.cc
View File

@ -23,11 +23,14 @@ namespace ag
static const luaL_Reg functions[] = {
{ "clearEventHandler", clearEventHandler },
{ "doPhysics", doPhysics },
{ "drawLine", drawLine },
{ "drawObjects", drawObjects },
{ "drawRect", drawRect },
{ "drawText", drawText },
{ "elapsedTime", elapsedTime },
{ "endFrame", endFrame },
{ "exit", exit },
{ "fillRect", fillRect },
{ "getCamera", getCamera },
{ "getScreenSize", getScreenSize },
{ "getTextSize", getTextSize },

View File

@ -64,6 +64,20 @@ mode is enabled; this mode is enabled by default.
See <a href="#ag_setAutoPhysics">setAutoPhysics</a> for more information.
</p>
<a name="ag_drawLine" />
<h3>drawLine</h3>
<p><tt>ag.drawLine(r, g, b, x1, y1, x2, y2 [, width])</tt></p>
<p>
This function tells the engine to draw a line to the screen.
The color of the line is given by (r, g, b).
The start and end coordinates of the line are (x1, y1) and (x2, y2).
<tt>width</tt> is an optional parameter and defaults to 1 if not
specified.
It controls the width of the line to be drawn.
<tt>drawLine()</tt> should normally be called from the
<tt>update_overlay</tt> event handler.
</p>
<a name="ag_drawObjects" />
<h3>drawObjects</h3>
<p><tt>ag.drawObjects()</tt></p>
@ -75,6 +89,31 @@ See <a href="#ag_setAutoDrawObjects">setAutoDrawObjects</a>
for more information.
</p>
<a name="ag_drawRect" />
<h3>drawRect</h3>
<p><tt>ag.drawRect(r, g, b, width, height, x, y [, rot])</tt></p>
<p>
This function draws a rectangle to the screen.
The color of the rectangle is given by (r, g, b).
The size is given by <tt>width</tt> and <tt>height</tt>.
The center of the rectangle is given by (x, y).
<tt>rot</tt> is an optional parameter that defaults to 0.0.
It specifies the rotation of the rectangle.
<tt>drawRect()</tt> should normally be called from the
<tt>update_overlay</tt> event handler.
</p>
<a name="ag_drawText" />
<h3>drawText</h3>
<p><tt>ag.drawText(message, r, g, b, ptsize, x, y)</tt></p>
<p>
This function draws the text <tt>message</tt>, which should be
a string, to the screen at position (x, y), with color
specified by (r, g, b), and with font size <tt>ptsize</tt>.
It should normally be called from the <tt>update_overlay</tt>
event handler.
</p>
<a name="ag_elapsedTime" />
<h3>elapsedTime</h3>
<p><tt>elapsed_msec = ag.elapsedTime()</tt></p>
@ -107,6 +146,20 @@ will be executed and callbacks to other events may still be called.
The engine should exit within one update step.
</p>
<a name="ag_fillRect" />
<h3>fillRect</h3>
<p><tt>ag.fillRect(r, g, b, width, height, x, y [, rot])</tt></p>
<p>
This function draws a solid, filled rectangle to the screen.
The color of the rectangle is given by (r, g, b).
The size is given by <tt>width</tt> and <tt>height</tt>.
The center of the rectangle is given by (x, y).
<tt>rot</tt> is an optional parameter that defaults to 0.0.
It specifies the rotation of the rectangle.
<tt>fillRect()</tt> should normally be called from the
<tt>update_overlay</tt> event handler.
</p>
<a name="ag_getCamera" />
<h3>getCamera</h3>
<p><tt>eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z = ag.getCamera()</tt></p>
@ -116,6 +169,15 @@ focus position (center coordinates), and up vector for the current
camera settings.
</p>
<a name="ag_getTextSize" />
<h3>getTextSize</h3>
<p><tt>width, height = ag.getTextSize(message, ptsize)</tt></p>
<p>
This function returns the width and height, in pixels, that
the text specified by <tt>message</tt>, which should be a string,
would take when drawn to the screen using font size <tt>ptsize</tt>.
</p>
<a name="ag_getScreenSize" />
<h3>getScreenSize</h3>
<p><tt>width, height = ag.getScreenSize()</tt></p>