anScript

Graphic window

Unless stated otherwise, all graphic window instructions are available in anScript for Web via webSupport.js and webSupport.ans

Graphic instructions:

graphicWindowCreate(var.i width, var.i height, var.s name)

Create graphic window.


graphicWindowCreate(var.s name)

Create fullscreen graphic window.


graphicWindowDelete()

Delete graphic window.


graphicWindowClear()

Clear graphic window.


graphicWindowSetPoint(var.i x, var.i y, var.i r, var.i g, var.i b)

Set point (x, y) with color (r, g, b).


graphicWindowSetBackgroundColor(var.i r, var.i g, var.i b)

Set background color of graphic window to color (r, g, b).


graphicWindowSetPointSize(var.f size)

Set point size.


graphicWindowSetCircle(var.i x, var.i y, var.i rd, var.i r, var.i g, var.i b)

Draw circle with center (x, y), radius rd and color (r, g, b).


graphicWindowSetConvexShape(var.i x1, var.i y1, var.i x2, var.i y2, var.i x3, var.i y3, ... , var.i r, var.i g, var.i b)

Draw convex shape with vertices (x1, y1), (x2, y2), (x3, y3), … and color(r, g, b).


graphicWindowSetText(var.i x, var.i y, var.s text, var.s fontPath, var.i fontSize, var.i r, var.i g, var.i b)

in anSript for Web fontPath is font name

Draw text at position (x, y), font from fontPath, size fontSize and color (r, g, b).


graphicWindowSetImage(var.i x, var.i y, var.s imagePath)

in anSript for Web imagePath is an URL

Draw image from imagePath at position (x, y).


graphicWindowCameraMove(var.i x, var.i y)

Move graphicWindow camera by (x, y).


graphicWindowCameraReset()

Reset graphicWindow camera position.


graphicWindowToggleDrawing(var.i logicValue)

Freeze (if logicValue false) or unfreeze (if logicValue true) the graphic window.


Keyboard and mouse instructions:

graphicWindowShowSoftKeyboard()

currently there is no supported systems

Show soft keyboard (in supported systems).


graphicWindowIsMouseButtonDown(&var.i m)

Check if left mouse button is down.


graphicWindowGetMousePosition(&var.i x, &var.i y)

Set x and y to mouse position relative to a graphic window (or -1 and -1 if window is not created).