Hello Guest

Author Topic: Paged Scrolling with a ScrollableArea  (Read 4277 times)

reefG

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Paged Scrolling with a ScrollableArea
« on: July 16, 2013, 06:14:37 pm »
Hello,

I'm implementing a scrollable area - it works great, but it would be nice if I could support paging.

Is this something that is possible?

Many Thanks for your help.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Paged Scrolling with a ScrollableArea
« Reply #1 on: July 16, 2013, 11:10:04 pm »
Not right now it isn't. If you want to implement it yourself, you will need to make it snap to some values in tk2dUIScrollableArea.BackgroundOverUpdate.

daklab

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Daklab - Experiments, Projects, Designs, Tips, and Tutorials Related to Creative Coding
Re: Paged Scrolling with a ScrollableArea
« Reply #2 on: October 07, 2013, 02:28:43 pm »
Don’t have the source in front of me, but are you suggesting to edit tk2dUIScrollableArea source to provide a publically accessible way to listen for tk2dUIScrollableArea.BackgroundOverUpdate? From what I recall there was no built in way to listen for BackgroundOverUpdate.

@reefG I've currently implemented this paging behavior listening for the backgroundUIItem.OnUpUIItem dispatch. It works but is inconsistent in the sense that the event may fire but the momentum of the swipe gesture continues the native scrolling behavior vs my implemented snap to position behavior.
Braindrop Labs - Games. Apps. Coded Art. www.braindroplabs.com

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Paged Scrolling with a ScrollableArea
« Reply #3 on: October 07, 2013, 11:49:41 pm »
No I was suggesting simply starting by modifying that function. We will look into this in a future version - its a lot easier now that we have layouts and layout containers - we now know how big each "element" is and where to snap to, rather than having hardcoded numbers in there,.