You guys have written some amazing code at this stage! I hope you had some time to play around with that touch moved code. We were using a bit of math to figure out where the
x position of our touch was, then we divided that by the width of our graphic. This was just to get us a number to plug into the
Color initializer. And it was a little bit to show off how we get the updated position of the user’s finger on the graphic.
We fed that color into the
setTintColor method on our graphic to visually show how often that new handler we set gets called.
Today we’re going to add a touch handler for when someone presses on the graphic.
We’ve done this before in previous pages. But this time we’ll use some of the other functions defined by the playground for playing music.
We’ll spend a lot of time customizing the behavior of our graphic when we tap on it. And we’ll also spend some time exploring all those messages to our
onTouchMovedHandler. Maybe we can come up with some other use for them?
We’ll see you at 1pm!