Module screen

Screen class subset of cairo drawing functions.

see https://www.cairographics.org/tutorial/

Functions

update () copy buffer to screen.
aa (state) enable/disable anti-aliasing.
clear () clear.
level (value) set level (color/brightness).
line_width (w) set line width.
line_cap (style) set line cap style.
line_join (style) set line join style.
miter_limit (limit) set miter limit.
move (x, y) move drawing position.
move_rel (x, y) move drawing position relative to current position.
line (x, y) draw line to specified point.
line_rel (x, y) draw line to specified point relative to current position.
arc (x, y, r, angle1, angle2) draw arc.
circle (x, y, r) draw circle.
rect (x, y, w, h) draw rectangle.
curve (x1, y1, x2, y2, x3, y3) draw curve (cubic Bézier spline).
curve_rel (x1, y1, x2, y2, x3, y3) draw curve (cubic Bézier spline) relative coordinates.
close () close current path.
stroke () stroke current path.
fill () fill current path.
text (str) draw text (left aligned).
text_right (str) draw text, right aligned.
text_center (str) draw text, center aligned.
font_face (index) select font face.
font_size (size) set font size.
pixel (x, y) draw single pixel (requires integer x/y, fill afterwards).
display_png (filename, x, y) display png.


Functions

update ()
copy buffer to screen.
aa (state)
enable/disable anti-aliasing.

Parameters:

  • state on(1) or off(0)
clear ()
clear.
level (value)
set level (color/brightness).

Parameters:

  • value 0-15 (0=off, 15=white)
line_width (w)
set line width.

Parameters:

  • w line width (in pixels, floats permitted)
line_cap (style)
set line cap style.

Parameters:

  • style line cap style string ("butt", "round" or "square"). default is "butt".
line_join (style)
set line join style.

Parameters:

  • style line join style string ("miter", "round" or "bevel"). default is "miter"
miter_limit (limit)
set miter limit.

Parameters:

  • limit if the current line join style is set to "miter", the miter limit is used to determine whether the lines should be joined with a bevel instead of a miter. if the length of the miter divided by the line width is greater than the miter limit, the style is converted to a bevel. default value 10.
move (x, y)
move drawing position.

Parameters:

  • x position x
  • y position y
move_rel (x, y)
move drawing position relative to current position.

Parameters:

  • x relative position x
  • y relative position y
line (x, y)
draw line to specified point.

Parameters:

  • x destination x
  • y destination y
line_rel (x, y)
draw line to specified point relative to current position.

Parameters:

  • x relative destination x
  • y relative destination y
arc (x, y, r, angle1, angle2)
draw arc.

Parameters:

  • x circle center x
  • y circle center y
  • r radius
  • angle1 start angle
  • angle2 end angle
circle (x, y, r)
draw circle.

Parameters:

  • x origin x
  • y origin y
  • r radius
rect (x, y, w, h)
draw rectangle.

Parameters:

  • x x position
  • y y position
  • w width
  • h height
curve (x1, y1, x2, y2, x3, y3)
draw curve (cubic Bézier spline).

Parameters:

  • x1 destination x
  • y1 destination y
  • x2 handle 1 x
  • y2 handle 1 y
  • x3 handle 2 x
  • y3 handle 2 y
curve_rel (x1, y1, x2, y2, x3, y3)
draw curve (cubic Bézier spline) relative coordinates.

Parameters:

  • x1 relative destination x
  • y1 relative destination y
  • x2 handle 1 x
  • y2 handle 1 y
  • x3 handle 2 x
  • y3 handle 2 y
close ()
close current path.
stroke ()
stroke current path. uses currently selected color.
fill ()
fill current path. uses currently selected color.
text (str)
draw text (left aligned). uses currently selected font.

Parameters:

text_right (str)
draw text, right aligned. uses currently selected font

Parameters:

text_center (str)
draw text, center aligned. uses currently selected font.

Parameters:

font_face (index)
select font face.

Parameters:

  • index font face (see list)

    1 04B_03 (norns default)

    2 ALEPH

    3 Roboto Thin

    4 Roboto Light

    5 Roboto Regular

    6 Roboto Medium

    7 Roboto Bold

    8 Roboto Black

    9 Roboto Thin Italic

    10 Roboto Light Italic

    11 Roboto Italic

    12 Roboto Medium Italic

    13 Roboto Bold Italic

    14 Roboto Black Italic

font_size (size)
set font size.

Parameters:

  • size in pixel height.
pixel (x, y)
draw single pixel (requires integer x/y, fill afterwards).

Parameters:

  • x position
  • y position
display_png (filename, x, y)
display png.

Parameters:

  • filename
  • x x position
  • y y position
generated by LDoc 1.4.6 Last updated 2019-04-04 20:07:57