es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tag: ANDROID-CANVAS

¿Cómo colocar una imagen sobre un punto en un lienzo?

¿Cómo puedo colocar una imagen en cada uno de los objetos? Actualmente solo muestra puntos, pero necesito mostrar una imagen. for (var i = 0; i < objects.length; i++) { var object = objects[i]; object.y += spawnRateOfDescent; ctx.beginPath(); ctx.arc(object.x, object.y, 8, 0, Math.PI * 2); ctx.closePath(); ctx.fillStyle = object.type; ctx.fill(); . . . Read more

Por qué mi objeto no cambia de posición cuando le añado un valor

<hmtl> <head> <!– <script src=’main.js’></script> –> </head> <body> <canvas id=’myCanvas’> </canvas> <script> function shape(x,y){ this.x=x; this.y=y; var canvas = document.getElementById(“myCanvas”); var ctx = canvas.getContext(“2d”); ctx.fillStyle = “#FF0000”; ctx.fillRect( this.x, this.y, 50, 50); } } var sqr=new shape(100,100) sqr.x+=100 </script> </body> </hmtl> Por qué le sumo 100 a x y espero . . . Read more

crear un bucle en Dart

Cómo animar un borde alrededor del contenido cuadrado. Intenté utilizar este código pero no pude hacer que se construyera con animación.. class RadialPainter extends CustomPainter { final double progressRemoval; final Color color; final StrokeCap strokeCap; final PaintingStyle paintingStyle; final double strokeWidth; final double progress; RadialPainter( {this.progressRemoval, this.color, this.strokeWidth, this.strokeCap, this.paintingStyle, . . . Read more