Hello Guest

Author Topic: Scrolling list  (Read 4686 times)

jhillman

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Scrolling list
« on: February 11, 2013, 10:44:51 pm »
I'm trying to figure out how to do a scrolling list of items without using GUI scripting.  I found this topic, where you provide a link to a technique for doing this with clipping:

http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,581.msg2769.html#msg2769

The link in that message is broken; do you have a current link or another place I can look for guidance on this?  Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scrolling list
« Reply #1 on: February 12, 2013, 12:09:46 am »
You'll need to register your copy as described here:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,34.0.html
To get access to the private support forums.

There will be a much nicer & vastly more efficient way to do this in 1.91, using camera viewports. There will be a demo of this in the final version.

jhillman

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Scrolling list
« Reply #2 on: February 12, 2013, 03:18:41 am »
Thanks for the quick reply and for the directions on registering.  I have done so, and I am just waiting for approval.  The camera clipping in 1.91 sounds perfect.  I have never dealt with a beta of 2D Toolkit before; if an upgrade goes wrong, is it difficult to revert back to a stable version?  If so, would it be wise to wait for the final release to implement this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scrolling list
« Reply #3 on: February 12, 2013, 01:48:36 pm »
Make a backup of your project before upgrading.... thats the best thing to do always :) If things go wrong, just go back to your backup project.

jhillman

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Scrolling list
« Reply #4 on: February 15, 2013, 04:25:57 am »
We went ahead and upgraded, and I have started experimenting with viewport clipping with a tk2dCamera, but there are a few things that I don't understand.  The brief description of viewport clipping in the release notes for 1.91 say to set the Depth parameter to something greater than my primary camera.  My primary camera has a Depth of -1; should I use a depth of 0, or does "greater" refer to magnitude, so -2 is more appropriate?  Next, the description says to set the clear flags to "Depth only" or "Don't clear" depending on what I want.  What I want is to only show the game objects that are within the bounds of the viewport rectangle.  Is this "Depth only"?  Do I then need to set the depth of the game objects to the depth of the tk2dCamera?  I thought this might be done in the settings for a sprite collection, but I haven't been able to find a way to edit a sprite collection in 1.91.  Thanks very much for your time.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scrolling list
« Reply #5 on: February 15, 2013, 01:46:19 pm »
Depth should be a larger value eg. -1 -> 0
"depth only" or "dont clear" depends on where your sprites are positioned. I'd start with depth only, but don't clear will be more efficient if you can use it. If you don't clear the depth buffer and sprites are physically behind other solid objects, they won't be visible.

You don't need to edit any sprites / sprite collections actually (you can bring back the edit button in 2d toolkit preferences).

Check this sample for a sample using the clipping. There are bugs which need to be resolved, but they will be before 1.91 final.
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1175.0.html