Scrollable Content Window? Unity iPhone

Hi all,

This might seem like a very basic question but it's something i've not needed to know until now...

A game i'm working on requires the user make a song selection from within the game (not a song from the iPod or anything, but a song from my own predefined list)... The number of songs to select from far-exceeds what can fit on one screen, so the user needs to be able to scroll down the list to make their selection. It might be nice if the scrollable area sat underneith the top-bar of the app so that scrolling doesn't push the top-bar off the screen.

I was wondering if there's anything built in for this purpose or if anyone had any suggestions for the best way to go about doing this? I'm using SpriteManager for all of my on-screen elements for performance (keeping down draw calls) and i'm avoiding OnGUI features which i'm told racks up draw calls.

My initial thought was that i'd have to physically move the camera to give the effect of scrolling and parent the background image to the camera so that it doesn't appear to scroll... however I figured there's probably a less cumbersome way to do this simple thing.

Any advice greatly appreciated as always.



As you won't display this menu all the time in your game I don't see why you couldn't use OnGUI(). There is GUI.ScrollView to deal with your problem... ;)

I guess i have something similar for my app's main menu system, where there are 13 selections available, with the screen only showing 3 of these at a time.

I place each of the 13 selections as GOs and use spritemanager2 to assign the texture from the atlas material.

I then use a touch controlled scroller script to control the main camera up and down the list. To the right of my list is an info bar that is a GUITexture. This also acts nicely as a frame (you could have it on top too if you want and the GOs would scroll under it).

(note that the above 13 items are NOT children of the main camera, but are placed in the scene one under the other).

I find this method very easy to set up and not costly on the draw cells too.

Hope this helps