- Code: Select all
lineto(0,0);
a function used to draw lines in a canvas from one point to another... helpful in many ways including images.
heres how it works::
- Code: Select all
setpen(255,200,250,0,1);
this turns the canvas into.. a canvas of art
255:red
200:green
250:blue
0:transparency
1:line thickness
moveto(0,0);
moves the starting point of your shape/line to this point.
(bare in mind the points are now relevant to the canvas, 0,0 is the top left corner of the canvas.)
lineto(20,20);
this will draw a line from point 0,0 to point 20,20 on the canvas.
the next lineto will draw a line from the above 20,20 to the new point.
for example: a box,
- Code: Select all
setpen(255,0,0,0,1);
moveto(0,0);
lineto(0,10);
lineto(10,10);
lineto(10,0);
simple 10x10 pixel box.
can also make the canvas itself a box by replacing the x 10s with width and the y 10s with height.
throughout a canvas you can make the pen colour change, if you want to outline the canvas in blue then draw a box in red. just simply write
setpen with another colour value before your box.
- Code: Select all
setpen(0,0,255,0,1);
moveto(0,0);
lineto(width,0);
lineto(width,height);
lineto(0,height);
setpen(255,0,0,0,1);
moveto(10,10);
lineto(10,20);
lineto(20,20);
lineto(20,10);
there is also erase(0,0,0,0);
this is used to remove any unwanted lines/pixels. put this at the top of a script. (below any variable declarations (int i = 0;))
then putpixel(0,0);
this places 1 pixel in the position indecated.
hope this was helpful its how many minimaps are made on GE and many games in general, experiment with it and enjoy.
savvy