File service/graphics.lua

A module of graphics functions, mapped to the base API's

Functions

graphics.drawRectangle (rect, o1, o2, o3, o4, size) Draws a rectangle of size {w, h} at 0, 0
graphics.getColor () Gets the current color in the form of {r, g, b}
graphics.getFont () Gets the current font
graphics.getHeight () Gets the height of the drawing area
graphics.getLineWidth () Gets the current line width
graphics.getPointSize () Gets the current point size
graphics.getScissor () Gets the current scissor in the form of {x, y, w, h}
graphics.getTextColor () Gets the current text color in the form of {r, g, b}
graphics.getWidth () Gets the width of the drawing area
graphics.newImage (...) Loads an image at path ...
graphics.pop () Calls pop matrix
graphics.push () Calls push matrix
graphics.setColor (c) Sets the current color
graphics.setFont (f) Sets the current font
graphics.setLineWidth (c) Sets the current linewidth
graphics.setPointSize (c) Sets the current pointsize
graphics.setScissor (s) Sets the scissor box
graphics.setTextColor (c) Sets the current text color
graphics.translate (t) Calls translate


Functions

graphics.drawRectangle (rect, o1, o2, o3, o4, size)
Draws a rectangle of size {w, h} at 0, 0

Parameters

  • rect:
  • o1:
  • o2:
  • o3:
  • o4:
  • size: {w, h}
graphics.getColor ()
Gets the current color in the form of {r, g, b}

Return value:

table
graphics.getFont ()
Gets the current font

Return value:

userdata
graphics.getHeight ()
Gets the height of the drawing area

Return value:

number
graphics.getLineWidth ()
Gets the current line width

Return value:

number
graphics.getPointSize ()
Gets the current point size

Return value:

number
graphics.getScissor ()
Gets the current scissor in the form of {x, y, w, h}

Return value:

userdata
graphics.getTextColor ()
Gets the current text color in the form of {r, g, b}

Return value:

userdata
graphics.getWidth ()
Gets the width of the drawing area

Return value:

number
graphics.newImage (...)
Loads an image at path ...

Parameters

  • ...: string
graphics.pop ()
Calls pop matrix
graphics.push ()
Calls push matrix
graphics.setColor (c)
Sets the current color

Parameters

  • c: {r, g, b}
graphics.setFont (f)
Sets the current font

Parameters

  • f: userdata
graphics.setLineWidth (c)
Sets the current linewidth

Parameters

  • c: number
graphics.setPointSize (c)
Sets the current pointsize

Parameters

  • c: number
graphics.setScissor (s)
Sets the scissor box

Parameters

  • s: a rectangle in the form of {x, y, w, h}
graphics.setTextColor (c)
Sets the current text color

Parameters

  • c: {r, g, b}
graphics.translate (t)
Calls translate

Parameters

  • t: {x, y}

Valid XHTML 1.0!