### Graphics Functions ##### graphics Starts the graphics mode. The argument here is an optional boolean. A true value indicates the graphics will use acceleration. In accelerated graphics mode, screen is only updated on #link: drawscreen# Example: ``` graphics(true) ``` #### graphicswindow Starts the graphics windowed mode. The first two arguments decides the width and height of the window. The third argument decides if the display is accelerated. Example: ``` graphicswindow(400, 200, true) ``` #### drawscreen Draws everything to the screen at once. Example: ``` drawscreen() ``` #### point Turns the pixel at given cordinates on, with the current drawing color. use #link: setcolor# to set drawing color. Example: ``` point(100, 100) ``` #### points Turns the pixels at the given coordinates on, with current drawing color. use #link: setcolor# to set drawing color. Example: ``` points([[100, 100], [200, 200]]) ``` #### line Draws a line from co-ordinates (100, 100) to (200, 200) using the current color use #link: setcolor# to set drawing color. Example: ``` line(100, 100, 200, 200) ``` #### lines Draws a sequence of lines from a list of points. Each point is represented by a list of two numbers, first one representing the x coordinate and the second one representing the y-coordinate. use #link: setcolor# to set drawing color. Example: ``` lines([[100, 100], [200, 200]]) ``` #### box Draws a rectangle in current color, with top left corner at co-ordinates (100, 100) and having 20 pixels wide and 30 pixel tall. use #link: setcolor# to set drawing color. Example: ``` box(100, 100, 20, 30) ``` #### circle Draws a rectangle in current color, with center at co-ordinates (100, 100) and having a radius of 20 pixels. use #link: setcolor# to set drawing color. Example: ``` circle(100, 100, 20) ``` #### setcolor Sets the current drawing color using red, green and blue component values. Example: ``` setcolor(100, 10, 200) ``` #### clearscreen Fills the graphics screen with current draw color. Example: ``` setcolor(0, 0, 0) clearscreen() -- paints the entire screen black. ``` #### getwindowsize Gets the dimensions of the graphics window. ``` graphics() let windowsize = getwindowsize() println(windowsize.width) println(windowsize.height) ``` #### setlogicalsize Sets the logical size of the display, so that things being drawn on screen are scaled to fit the entire dimensions of actual display. Check #link: Graphics and Animation# to read more about using this function. #### waitforkey Waits for the user to press a key when the graphics window is in focus. Example: ``` waitforkey() ```