Skip to content

Instantly share code, notes, and snippets.

@gretaf007
Created September 28, 2020 16:50
Show Gist options
  • Save gretaf007/6072da700f49b13f1ec1b2f076bd2ff9 to your computer and use it in GitHub Desktop.
Save gretaf007/6072da700f49b13f1ec1b2f076bd2ff9 to your computer and use it in GitHub Desktop.
c1 = color(70, 160, 500)
c2 = color (200, 200, 255)
def setup():
size(600, 600)
stroke(155, 155, 255, 50)
frameRate(24)
global c1
global c2
def draw():
size(600, 600)
lerpColor(c1, c2, .5)
rect(0,0, 600, 317)
fill(209)
circleM = map(mouseY, 0, width-pmouseX, width-pmouseY,0)
circle(120, circleM, 65)
fill(255, 150, 0)
circleS = map(mouseY, 0, width, width,0)
circle(450, circleS, 65)
photo = loadImage("Valley-Taurus-Mountains-Turkey.jpg")
image(photo, 0, 315)
@rors
Copy link

rors commented Sep 30, 2020

I see. So then try reversing the order of the fourth and fifth arguments to map().

In other words, on line 23 for example you could change it to this:

  circleS = map(mouseY, 0, width, 0, width)

Although then map() is doing nothing and you could just use mouseY instead of circleS, and delete that map command altogether.

@gretaf007
Copy link
Author

Ohhhh, thank you so much, yes that was a very obvious solution. Thank you Rory!

@rors
Copy link

rors commented Sep 30, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment