Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNehemiah Reese
17,692 PointsHow does the frame origin move down if it is += 20.0
Need help understanding
2 Answers
Richard Lu
20,185 PointsHi Nehemiah,
The frame is positioned like this with x marking the origin (5, 5).
0 1 2 3 4 5 6 7 8 9
1
2
3
4
5 x
6
7
8
9
If we add frame.origin.y += 2, the origin will be (5, 7) which moves down.
0 1 2 3 4 5 6 7 8 9
1
2
3
4
5
6
7 x
8
9
I hope this gives you a better picture of what's actually happening. Happy coding! :)
Nehemiah Reese
17,692 PointsThanks!