Painter project I made before


#1

So before when I was more active in kano world, I made this painter app. Feel free to look at it! https://world.kano.me/creation/painter_6

Here is the code:

var item, setColor, brushSize, penSize;


devices.get('colorblack').when('clicked', function () {
  setColor = '#212121';
});

devices.get('colorlightgreen').when('clicked', function () {
  setColor = '#8BC34B';
});

devices.get('colorpurple').when('clicked', function () {
  setColor = '#7B1FA2';
});

devices.get('colorred').when('clicked', function () {
  setColor = '#E64A19';
});

devices.get('colorgreen').when('clicked', function () {
  setColor = '#1B5E20';
});

devices.get('colorpink').when('clicked', function () {
  setColor = '#F48FB1';
});

devices.get('colororange').when('clicked', function () {
  setColor = '#FFA000';
});

devices.get('colorlightblue').when('clicked', function () {
  setColor = '#29B6F6';
});

devices.get('colorbrown').when('clicked', function () {
  setColor = '#795549';
});

devices.get('colorblue').when('clicked', function () {
  setColor = '#0D47A1';
});

devices.get('coloryellow').when('clicked', function () {
  setColor = '#FDD835';
});

global.when('start', function () {
  setColor = '#212121';
  brushSize = 20;
  penSize = 5;
  devices.get('paint').setCursor(assets.getSticker('other', 'other-paintbrush'));
});

devices.get('cleardrawing').when('clicked', function () {
  devices.get('normal').reset();});

devices.get('choosebrush').when('clicked', function () {
  devices.get('paint').setCursor(assets.getSticker('other', 'other-paintbrush'));
});

devices.get('paint').on('up', function (){
  if (assets.getSticker('other', 'other-paintbrush')) {
    brushSize = 0;
    penSize = 0;
    devices.get('normal').setTransparency(100);setColor = '#FAFAFA';
  } else if (assets.getSticker('other', 'other-pen')) {
    brushSize = 0;
    penSize = 0;
    devices.get('normal').setTransparency(100);setColor = '#FAFAFA';
  }
});

devices.get('choosepen').when('clicked', function () {
  devices.get('paint').setCursor(assets.getSticker('other', 'other-pen'));
});

devices.get('paint').on('down', function (){
  if (assets.getSticker('other', 'other-paintbrush')) {
    time.every(1, 'frames', function () {
      brushSize = 20;
      penSize = 0;
      devices.get('normal').setTransparency(70);devices.get('normal').modules.setters.color(setColor);
      devices.get('normal').modules.space.moveTo(devices.get('paint').getX(), devices.get('paint').getY());
      devices.get('normal').modules.shapes.square(penSize);devices.get('normal').modules.shapes.circle(brushSize);
    });
  } else if (assets.getSticker('other', 'other-pen')) {
    time.every(1, 'frames', function () {
      penSize = 5;
      brushSize = 0;
      devices.get('normal').setTransparency(70);devices.get('normal').modules.setters.color(setColor);
      devices.get('normal').modules.space.moveTo(devices.get('paint').getX(), devices.get('paint').getY());
      devices.get('normal').modules.shapes.circle(brushSize);
      devices.get('normal').modules.shapes.square(penSize);});
  }
});

Amazing Pixel Kit wallpapers by Retronator
#2

Very cool! Can you also post some of the artworks you made with it?


#3

I’m no artist but I guess if you insist!