hello173

new brush tool

Nov 30th, 2021 (edited)
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function brush(){
  2.   if(brushOn){
  3.     for(var t=0;t<4;t++){
  4.       for(var u=0;u<4;u++){
  5.         OWOP.world.setPixel(t+Math.floor(OWOP.mouse.tileX/4)*4,u+Math.floor(OWOP.mouse.tileY/4)*4,OWOP.player.selectedColor)
  6.       }
  7.     }
  8.   }
  9. };
  10. brushOn=false;
  11. setInterval(brush);
  12. OWOP.tools.addToolObject(new OWOP.tools.class("Brush", OWOP.cursors.brush, OWOP.fx.player.RECT_SELECT_ALIGNED(4), false, function(tool) {
  13.   tool.setEvent("mousedown", () => {
  14.     brushOn=true
  15.   });
  16.   tool.setEvent("mouseup", () => {
  17.     brushOn=false
  18.   });
  19. }));
Add Comment
Please, Sign In to add comment