Evolved from my other entry, this one is kind of a simple paint tool. It’s a little hard to use, but is about as good a balance between tediousness to use and using little code as I can do. (Ultimately, I could convert the last function to use the first, but I don’t feel the need, since I’m still within the limit)
_root.createEmptyMovieClip("artist", 1);
function drawnew(i, j) {
colour = (Math.floor(_root._xmouse/20)/19*4095 << 12)+Math.floor(_root._ymouse/20)/19*4095;
_root.artist.moveTo(i*20, j*20);
_root.artist.beginFill(colour, 100);
_root.artist.lineTo(i*20+20, j*20);
_root.artist.lineTo(i*20+20,j*20+20);
_root.artist.lineTo(i*20, j*20+20);
}
function onMouseDown() {
_root.tx = Math.floor(_root._xmouse/20);
_root.ty = Math.floor(_root._ymouse/20);
_root.cset = false;
}
function onEnterFrame() {
if (!_root.cset) {
drawnew(_root.tx, _root.ty);
}
}
function onMouseUp(){
_root.cset = true;
}
function palette() {
for (i=0; i<20; i++) {
for (j=0; j<20; j++) {
colour = (Math.floor(i)/19*4095 << 12)+Math.floor(j)/19*4095;
_root.artist.moveTo(i*20, j*20);
_root.artist.beginFill(colour, 100);
_root.artist.lineTo(i*20+20, j*20);
_root.artist.lineTo(i*20+20, j*20+20);
_root.artist.lineTo(i*20, j*20+20);
}
}
}
palette();
To use it, simply click and hold on the tile you want to colour, then move the mouse until it becomes the colour you want. Release the mouse to lock the colour. I have it set to display all possible colours from the start.