Lua console Graphics

  • mniip
    21st Jun 2011 Developer 0 Permalink
    Yeah its in creations because i CREATED it.
    source: http://pastebin.com/1tjW7zZG
    Russian alternate: http://pastebin.com/r2hu08W2
    description:

    mgr.drawln(line,x,y,type of particles)
    draws line of letters
    returns line length
    (to write ' write \'
    to write " write \"
    to write \ write \\
    its not because i want but Lua works so)

    mgr.putpixel(x,y,type of particle)
    draws 1 pixel at (x;y)

    mgr.getpixel(x,y)
    returns type of pixel at (x;y) - numeric

    mgr.line(x1,y1,x2,y2,type of particles)
    draws line from (x1;y1) to (x2;y2)

    mgr.circle(x,y,radius,type of particles)
    draws circle at (x;y) with preset radius

    mgr.rectangle(x1,y1,x2,y2,type of particles)
    draws rectangle with 2 corners at (x1;y1) and (x2;y2)

    mgr.floodfill(x,y,type of particles)
    SHOULD floodfill the area BUT DONT RUN
    DOESNT WORKS, it may CRASH TPT

    to use: load source from pastebin
    save it in file in PT folder.
    be sure u know EXTENSION
    (ex: text file has .txt extension, paint file has .bmp)
    then open TPT
    in lua write:
    dofile("[name of file]")
    name should be WITHOUT PATH BUT WITH EXTENSION
    then use any (but not floodfill) functions
    source example (after dofile):
    mgr.drawln("Hello, world!",100,100,"CLNE")
    mgr.rectangle(99,99,153,109,"DMND")
    mgr.line(99,99,123,92,"DMND")
    mgr.line(123,92,153,99,"DMND")
    mgr.circle(123,86,6,"BIZS")
    Edited by mniip, 2011-06-20 09:51:54
  • inik
    21st Jun 2011 Member 0 Permalink
    This is realy useful. (:
  • Petrol
    21st Jun 2011 Member 0 Permalink
    I dont get. (is this necro?)
  • BlueAmulet
    21st Jun 2011 Member 0 Permalink

    Deleted

    Edited once by BlueAmulet. Last: 11th Apr 2024