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

63
Views
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
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!