Game Development Community

Scroll Wheel needed

by Michael Inglis · in iTorque 2D · 08/11/2010 (2:38 am) · 2 replies

I am new to torque and to iphone app development in general. But what I need to do is to work out how to create a circular finger scroll wheel with a series of numbers. Similar this this image:

http://iphone.laroseweb.com/wp-content/uploads/2009/12/trigWheelScreenShot.png

Can anyone provide some (easy to follow) steps on how I can accomplish this?

Thanks,
Mike.

About the author

Recent Threads


#1
08/11/2010 (4:03 am)
Hi Michael,

That picture shows what is known as a "picker", which is something that is built into the iPhone cocoa framework. You can easily produce something like that using the standard tools in XCode. The easiest way would be to use "interface builder", which provides a GUI where you can easily drag and drop a picker into your window view. However, in order to create something like that you would need to build the front end using the standard iPhone tools, and then link that to your iTorque project, which is something I haven't tried doing thus far. It's probably easy to do though. As far as I know, iTorque doesn't haven any direct support for interface builder, so my understanding is that you'd need to use the standard iPhone tools (objective-C and interface builder).

A simple picker app is pretty straighforward to create though, although there are quite a lot of steps so it's not easy to explain in a few words. I would recommend an iPhone book. There are quite a few good books out now that explain how to build a simple picker app. One example is the "Head First iPhone Development" book by O'Reilly. They have a picker application example in chapter 2, and if you follow that you can easily create a simple example in just a few minutes. There is nothing complicated about it.

Here is a link to the book I'm talking about:

http://www.amazon.com/Head-First-iPhone-Development-Applications/dp/0596803540/ref=sr_1_1?ie=UTF8&s=books&qid=1281499164&sr=8-1

Here is another good book also:

http://www.amazon.com/gp/product/1430224592/ref=cm_cr_asin_lnk

#2
08/13/2010 (5:11 am)
Thanks for your response. I will have a look at those books.

What I have tried to do in torque is create an extra long png file that extends above and below the world limit of the iphone screen and then created a blended image that creates the perception of a wheel.

What I need to do next is assign mouse/touch events so that the png scrolls up or down depending on whether the mouse/touch is dragged up or down. Do you have any suggestions on how to achieve this?

I can get it to work by using onmousedown and setpositionY to worldpos.y but this causes it to simply move to that location and doesn't scroll smoothly or allow movement beyond the world limits.