Functions

Context(init) Constructor
Context:add_view(v) Add a view to the context
Context:draw() Draw the context
Context:get_font(size) Get a font for a particular size
Context:key(e, k) Create a key event
Context:mouse(e, btn, x, y, nclk) Create a mouse event
Context:resize(dim) Resize the context
Context:view_at_point(x, y) Get a view at a point

Functions

Context(init)

Constructor

Parameters:

init Constructor properties
init.ctx The context name
Context:add_view(v)

Add a view to the context

Parameters:

v [NO DESCRIPTION]
Context:draw()

Draw the context

Context:get_font(size)

Get a font for a particular size

Parameters:

size The size
Context:key(e, k)

Create a key event

Parameters:

e The event name
k The key
Context:mouse(e, btn, x, y, nclk)

Create a mouse event

Parameters:

e The event name
btn The button name
x x-coordinate
y y-coordinate
nclk The number of clicks
Context:resize(dim)

Resize the context

Parameters:

dim The dimensions
Context:view_at_point(x, y)

Get a view at a point

Parameters:

x x-coordinate
y y-coordinate

Return:

  • The view's layer
  • The view