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

155
Views
Rotar de un elemento específico dentro del lienzo JS

¿Es posible que en este código

 <canvas id="ctx" width="500" height="500" style="border:1px solid #000000;"></canvas> <script> setInterval(function() { testf(); },1000/25); var ctx = document.getElementById("ctx").getContext("2d"); var img = new Image(); img.src = 'C:/.../img/player.png'; var img2 = new Image(); img2.src = 'C:/.../img/player2.png'; // ctx.rotate(45 * Math.PI / 180); function testf() { ctx.clearRect(0,0,500,500); ctx.rotate(5 * Math.PI / 180); ctx.drawImage(img,100,100); ctx.drawImage(img2,200,200); }; </script>

era posible rotar solo el jugador 2, y no todos los elementos del lienzo. Opciones, crear otro lienzo, no estoy satisfecho. Me gustaría implementar esto a través de JS, por ejemplo, img.rotate 5; o rotar(este.ángulo); pero no sé cómo escribirlo correctamente.

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!