0
\$\begingroup\$

This question already has an answer here:

I'm developing an application for iPhone with a screen where the user will track his progress. Something like so, as seen in the Two Dots game:

enter image description here

Currently I plan on creating this using constraints and size classes. But I feel its too much of work for each screen size. I've set a background UIImageView and I place different circles, manually hardcoding the position. The curved path in my case is made of a texture. So I can't plot it using Bezier Curves either.

Is there an easier way to do it? Perhaps using SpriteKit or Cocos2D-x?

\$\endgroup\$

marked as duplicate by Kromster says support Monica, bummzack, Josh Feb 11 '15 at 21:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0
\$\begingroup\$

I am not familiar with SpriteKit, or Cocos2D, so I can't answer that question. However you should be able to accommodate any screen size if you use percentages. If you calculate the percent of pixels where each circle is placed in regards to your original image, you can use this value to calculate the placement of each marker in the target resolution.

For example, in the image you posted, the top left corner of circle 35, looks to be at (roughly) 55% of the screens width, and 45% of the screens height. If these values are accurate, you can calculate the screen position in any resolution very easily.

x = screenWidth * circlePositionWidthPercantage;
y = screenHeight * circlePositionHeightPercantage;
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.