Create PickerView/Tumbler like in xcode

robert.mccarthyrobert.mccarthy Member Posts: 165
edited June 2012 in Working with GS (Mac)
Hi All,

Does anyone have an idea/template on how to implement a PickerView/Tumbler like you get in xcode?

Just throwing it out there :)

Thanks,

Best Answer

  • ORBZORBZ Posts: 1,304
    edited June 2012 Accepted Answer
    You'll have to build it from scratch. There are no native GUI widgets in GS except for native text input.

    I would start with a stack of items that all scroll on Y. Have an actor above them to make the border and shadow. Code the drag to scroll behavior and make all the items reflect the scrolling so that you can have a "list"

    Alternatively, if it's a full screen list you can just stack the items and then move the camera on Y axis in relation to the drag-to-scroll logic you will have to implement. This is probably easier but only viable if the list is full screen.

    This really seems like a lot of work for a small UI element. If possible I would suggest an alternative UI design unless it's crucial to your game.

Answers

  • MobileRocketGamesMobileRocketGames Member Posts: 128
    edited June 2012
    If you are talking about a folder view and If you never need to update or change the list; You could create a very very simple one by just using actors and rules.

    Place all the actors in the scene, but off screen. Have the folder icon or whatever you choose tell those other actors to move into position instantly when the folder is pressed.
    Super super easy, but if you want to change the contents of a folder you will need to do it manually.

    On the other hand if you want to get more technical you could just create one using tables and dynamically load the content/images/names.

  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Not really what I need. Have you seen the pickerviews/tumblers that scroll/rotate?

    It is one of these I am trying to implement: http://bit.ly/LuRvZK

    Thanks though
Sign In or Register to comment.