Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
Check if object is painted

I'm trying to create a coloring game for kids using animate cc. I used the following code:

var drawingCanvas;
var oldPt;
var oldMidPt;
var color;
var stroke = 50;
var index;
var that = this;
this.colorArray = ["#FF0000", "#009900", "#FFFF00", "#0000FF", "#000000", "#FF00FF"];

function init() {
   index = 0;
   createjs.Touch.enable(stage);
   drawingCanvas = new createjs.Shape();
   stage.addEventListener("stagemousedown", handleMouseDown);
   stage.addEventListener("stagemouseup", handleMouseUp);
   that.obj1.addChild(drawingCanvas);
   //that.obj1.update();
}

function handleMouseDown(event) {
   color = that.colorArray[(index++) % that.colorArray.length];
   oldPt = that.obj1.globalToLocal(stage.mouseX, stage.mouseY);
   oldMidPt = oldPt.clone();
   stage.addEventListener("stagemousemove", handleMouseMove);
}

function handleMouseMove(event) {
   var midPt = that.obj1.globalToLocal(stage.mouseX, stage.mouseY);
   drawingCanvas.graphics.setStrokeStyle(stroke, 'round',  'round').beginStroke(color).moveTo(midPt.x, midPt.y).curveTo(oldPt.x, oldPt.y, oldMidPt.x, 
  oldMidPt.y);
   oldPt.x = midPt.x;
   oldPt.y = midPt.y;
   oldMidPt.x = midPt.x;
   oldMidPt.y = midPt.y;
   //stage.update();
}

function handleMouseUp(event) {
   stage.removeEventListener("stagemousemove", handleMouseMove);
}
init();

There is a movieclip where color will be applied and another movie clip above that which is just outline of the object. My question is, is it possible to check if the object is fully colored? Or is there any way to get the shape's color?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda