Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I was thinking of make a slider/joystick but not in a circle but in a line. So I made the image drag able only over the X axis and when it gets to the point where the slider stops i did this :

if(slider.center.x <= 60) {
      slider.center = CGPointMake(60, slider.center.y);
}

so it wouldn't get bigger than 60 but i was thinking isn't there a better way to do this? like make a boundary box and setting up something to not drag it outside that box?

Thanks!

share|improve this question
which api are you using? – Gajoo Sep 19 '11 at 17:57
nothing :p but i already solved – jan Sep 21 '11 at 17:19

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.