Skip to content
Alessandro Febretti edited this page Dec 11, 2014 · 5 revisions

Last revision: ver. 6.0 - 25 October 2014

module omega wraps omega::DrawInterface

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.
int findUniform(int program, string name) Finds the program uniform with the specified name.
void uniformFloat(int uniform, float value) Sets a float uniform value.

Remarks

Valid align flags for drawText:

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