10-02-2015, 03:11 PM
Frank_Stein Wrote:salix_catus Wrote:Being able to draw tiny pixel art on paper then stapling it to walls as posters would be good.Honestly, I would love if pens and papers worked like that, but is that feasible codewise?
Totally, if you where to create a object that would catch the attack of the user, and then grab the relative X/Y and then colour a single pixel, alongside some zooming functionality so you could zoom in/out.
Code:
//Interface for using DrawBox() to draw 1 pixel on a coordinate.
//Returns the same icon specifed in the argument, but with the pixel drawn
/proc/drawPixel(var/icon/I,var/colour,var/x,var/x)
if(!I)
return 0
if(x> I.Width()|| x<= 0)
return 0
if(y> I.Width()|| y<= 0)
return 0
I.DrawBox(colour, x, y)
return I
/atom/proc/drawPixelOn(var/colour, var/x, var/y)
var/icon/I = new(icon)
var/icon/J = drawPixel(I, colour, x, y)
if(J)
icon = J
return J
return