Tag: ANDROID-CANVAS
¿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
Estoy construyendo un motor gráfico en 2D utilizando webgl, JavaScript y HTML. Quería utilizar la biblioteca gráfica gl-Matrix.js para hacer las transformaciones, así que descargué el archivo zip de la biblioteca gl-Matrix desde su sitio web https://glmatrix.net y lo extraje en una carpeta llamada lib en mi proyecto. No olvidé . . . Read more
<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
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
Tuve algunos problemas con un lienzo. He creado un montón de palabras que se mueven dentro del elemento y quiero cambiar el estilo de una sola palabra al hacer clic. La función de clic funciona bien, pero: Si intento detener y escalar la palabra, el script funciona correctamente; Si intento . . . Read more