Here we pack a bunch of shapes from random positions and scales. If we had different scales to start then use the ZIM fit() to fit each object into a certain size. Then Tile those - store a startScale as well as the startX and startY from the example. See https://zimjs.com/five/ packshapes.html
So come on in and see what you can code in FIVE minutes with ZIM at https://zimjs.com. ZIM is free open-source JavaScript made easy for creative coding on the HTML canvas! For example, here is simple code for a draggable circle: new Circle().center().drag();Please subscribe to our channel here: https://www.youtube.com/c/zimlearn?sub_confirmation=1and check out the playlists for tutorials on learning JavaScript and programming tips.All five minute demonstrations can be found at: https://zimjs.com/five/ - view in browser or text editor to see code. We use Atom with the optional open in browser package installed. View the ZIM site for Examples of Interactive Media at https://zimjs.com/examples.html and a Learn section with free lessons, tutorials and workshops at https://zimjs.com/learn.html.