Question: How I would I scale a drawing based on the canvas size? The canvas right now is size(420,420); say, if I wanted to make the

How I would I scale a drawing based on the canvas size? The canvas right now is size(420,420); say, if I wanted to make the canvas larger to (600,600); the image would still be the same size, what would I need to do to my eight variables provided below to get it to scale to any canvas size I change it to?

Here's my code, and variables using processing

size(420,420);

int centreIce= (the x coordinate of the centre line of the ice) int tLine= (the y coordinate of the centre of all the circles) int diam1foot, diam4foot, diam8foot,diam12foot= (the diameters of the four circles) int iceWidth, iceLeft= (the width of the ice, and the x coordinate of its left side)

//Icy Rectangle fill(200,225,255); rect(50,0,320,420);

//Red circle fill(255,0,0); ellipse(210,120,240,240);

//White circle fill(255); ellipse(210,120,160,160);

//Blue circle fill(0,0,255); ellipse(210,120,80,80);

//Yellow circle fill(255,255,0); ellipse(210,120,20,20);

//Lines line(210,0,210,420); // Vertical line(50,120,370,120); // Horizontal

The Language used is Processing (Java)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!