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

65
Vistas
Ball bounce canvas background of balls

I would like to know if it was possible to put an image in the background instead of a color?

I've been stuck for a few days and can't find a solution ...

here you will find my jsfiddle : https://jsfiddle.net/kna3et87/

thank you very much for any help :) !!

Here I call on my variables

var balls = function() {
  
  /* configuration */
  var BALL_NUMBER    = 100;
  var BALL_SIZE      = 60;
  var BALL_COLOR     = "red";
  var BACK_COLOR     = "fff";
  var GRAVITY_X      = 0;
  var GRAVITY_Y      = 0.5;
  var MOUSE_REPEL    = false;
  var MOUSE_STRENGTH = 1.4;
  var BOUNCINESS     = 0.8;
  var FRICTION       = 1.01;
  var WALL_STICK     = false;
  var WALL_BOUNCE    = true;
  var STICKINESS     = 50;

 

And here my parameters :

context.beginPath();
        context.fillStyle = BALL_COLOR;
        context.arc(this.x, this.y, BALL_SIZE / 2, 0, Math.PI * 2, true);
        context.closePath();
        context.fill();
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