canvasAPI

Source files:

prog/gameLibs/daRg/canvasDraw.cpp

Script API:

Use it to draw in canvas, by adding draw function in rendObj = ROBJ_VECTOR_CANVAS components description this function should accpets two arguments draw(api, rectElem) rectElem is table with {w=width, h=height} (in pixels).

‘api’ is pseudo object that has following functions:

line([x0, y0, x1, y1, ...], line_width, line_color)
line_dashed([x0, y0, x1, y1, ...], line_width, line_color)
fill_poly([x0, y0, x1, y1, ...], line_width, line_color, fill_color)
fill_inverse_poly([x0, y0, x1, y1, ...], line_width,line_color, fill_color)
ellipse(x, y, radius_x, radius_y, line_width, line_color, mid_color, fill_color)
sector(x, y, radius_x, radius_y, angle_0, angle_1, line_width, line_color, mid_color, fill_color)
rect(x0, y0, x1, y1, line_width, line_color, mid_color, fill_color)
function line(arg0, arg1, arg2)
Arguments:
  • arg0 (array()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:4

typecheck mask: userdata, array, integer_or_float, any_type

function line_dashed(arg0, arg1, arg2, arg3, arg4)
Arguments:
  • arg0 (array()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg3 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg4 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:6

typecheck mask: userdata, array, integer_or_float, integer_or_float, integer_or_float, any_type

function fill_poly(arg0, arg1, arg2, arg3)
Arguments:
  • arg0 (array()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (any_type()) – autodoc from typemask/paramscheck

  • arg3 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:5

typecheck mask: userdata, array, integer_or_float, any_type, any_type

function fill_inverse_poly(arg0, arg1, arg2, arg3)
Arguments:
  • arg0 (array()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (any_type()) – autodoc from typemask/paramscheck

  • arg3 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:5

typecheck mask: userdata, array, integer_or_float, any_type, any_type

function ellipse(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
Arguments:
  • arg0 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg3 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg4 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg5 (any_type()) – autodoc from typemask/paramscheck

  • arg6 (any_type()) – autodoc from typemask/paramscheck

  • arg7 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:9

typecheck mask: userdata, integer_or_float, integer_or_float, integer_or_float, integer_or_float, integer_or_float, any_type, any_type, any_type

function sector(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
Arguments:
  • arg0 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg3 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg4 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg5 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg6 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg7 (any_type()) – autodoc from typemask/paramscheck

  • arg8 (any_type()) – autodoc from typemask/paramscheck

  • arg9 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:11

typecheck mask: userdata, integer_or_float, integer_or_float, integer_or_float, integer_or_float, integer_or_float, integer_or_float, integer_or_float, any_type, any_type, any_type

function rect(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
Arguments:
  • arg0 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg1 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg2 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg3 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg4 (integer_or_float()) – autodoc from typemask/paramscheck

  • arg5 (any_type()) – autodoc from typemask/paramscheck

  • arg6 (any_type()) – autodoc from typemask/paramscheck

  • arg7 (any_type()) – autodoc from typemask/paramscheck

nparamscheck:9

typecheck mask: userdata, integer_or_float, integer_or_float, integer_or_float, integer_or_float, integer_or_float, any_type, any_type, any_type