x


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.

Thanks

Mat

more ▼

asked Apr 27 '10 at 08:56 AM

Mat Brummitt gravatar image

Mat Brummitt
220 21 23 32

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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... ;)

more ▼

answered Apr 27 '10 at 09:43 AM

StephanK gravatar image

StephanK
6k 39 53 93

I guess 1 added draw call wouldn't hurt, but would I not need to use other GUI elements to make up the song selection elements? Or, is there a way I could use SpriteManager in conjunction with GUI.ScrollView?

Thanks very much for your help

Apr 27 '10 at 10:12 AM Mat Brummitt

Never used SpriteManager, so don't know the answer to that question.

Apr 27 '10 at 06:03 PM StephanK

However, the point was, that when showing a menu fps isn't that important, so that keeping drawcalls down maybe isn't necessary.

Apr 27 '10 at 06:05 PM StephanK
(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Jul 16 '10 at 02:41 AM

Groov gravatar image

Groov
11 1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3721
x1999
x200
x56
x19

asked: Apr 27 '10 at 08:56 AM

Seen: 2549 times

Last Updated: Apr 27 '10 at 08:56 AM