Skip to content
Alessandro Febretti edited this page Oct 26, 2014 · 5 revisions

module omega wraps omega::DrawInterface EXPERIMENTAL

Exposes methods to simplify drawing on 2d surfaces. Used in conjunction with setDrawFunction

Methods

Method(s) Description
drawRectGradient(position, size, orientation)
drawRect(position, size, color)
drawRectOutline(position, size, color)
drawText(text, font, position, alignFlags)
drawCircleOutline(position, radius, color, segments)
createFont(fontName, fileName, size)
getFont(name)
getDefaultFont()
(v6.0) Shaders
int getOrCreateProgram(string name, string vertexFile, string fragmentFile) Gets or creates a new shader program. If the program does not exists, attempts to create it using the two passed files as source for a vertex and a fragment shader.
int getOrCreateProgramFromSource(string name, string vertexSource, string fragmentSource) Gets or creates a new shader program. If the program does not exists, attempts to create it using the two passed strings as source for a vertex and a fragment shader.
void program(int program) Enables the specified program. Pass 0 to switch back to fixed pipeline drawing.

Remarks

Valid align flags for drawText:

  • TextAlign.HALeft
  • TextAlign.HARight
  • TextAlign.HACenter
  • TextAlign.VATop
  • TextAlign.VABottom
  • TextAlign.VAMidde
Clone this wiki locally