Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
Elemento de ajuste de lona a la cuadrícula

oye, tengo un elemento de lienzo donde hay barcos y necesitaría exactamente lo mismo que aquí en el ejemplo https://codepen.io/pierrebleroux/pen/gGpvxJ sin marcos pero no sé cómo hacerlo

aquí está mi código https://codepen.io/cleks/pen/xxrzbLQ

función de movimiento

 function handleMouseDown(e){ mouseX=parseInt(e.clientX-offsetX); mouseY=parseInt(e.clientY-offsetY); // mousedown stuff here lastX=mouseX; lastY=mouseY; mouseIsDown=true; } function handleMouseUp(e){ mouseX=parseInt(e.clientX-offsetX); mouseY=parseInt(e.clientY-offsetY); // mouseup stuff here mouseIsDown=false; } function handleMouseMove(e){ if(!mouseIsDown){ return; } mouseX=parseInt(e.clientX-offsetX); mouseY=parseInt(e.clientY-offsetY); // mousemove stuff here for(var i=0;i<ships.length;i++){ var ship=ships[i]; drawShip(ship); if(ctx.isPointInPath(lastX,lastY)){ ship.x+=(mouseX-lastX); ship.y+=(mouseY-lastY); ship.right=ship.x+ship.width; ship.bottom=ship.y+ship.height; } } lastX=mouseX; lastY=mouseY; drawAllShips(); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!