I need to add acceleration to AceSlide so you can go through a large set very quickly but I am not sure how. This is the same way as apple does scrolling. Any help would be great!
Also I want to have the items in the slide to stop on the selected row at the top rather than in the middle of the screen.
And as it inherits from sprite you can change position using setPosition method (just like sprite) only with two gotchas:
And about speed, when creating instance you can provide different configurations like
Thanks for the response. I was using the version linked. I actually modified quite a bit to get things to not work centered as I want rows to stop at the top not the center. Its a bit buggy but works.
One issue I have. I have added the slider to a sprite that is half the height of the screen but the cards are still drawn even though the spite shouldn't exist there right? I would think gideros would treat sprite as a self contained unit and wouldn't paint outside of it right? if not how would I accomplish this?
One fix was to draw the Shape object around or use some kind of picture as a mask, that would be put on top of it
Here is some discussion on this:
Also, if you use an option called setDisabledAlpha(), you can cause the items to fade out either side of the current one. This can have the effect of "masking" the slider if you don't want to do the picture mask trick that @ar2rsawseen suggests above.
The demo just shows sliding of text fields but, of course, you can add any sprites you like to the slider.
You can get the code and the demo project from my GitHub repo here.
I will check it out. Did you overcoming the clipping limitation ar2rsawseen mentioned? Without such a basic feature as clipping/masking I don't understand how anyone would pay for Gideros clipping. The performance of just covering up object is huge and plus I don't understand how you could ever make a full UI library or even a basic one.
Is there any way to have the objects stop at the top rather than the center. I want to have a full image at the top always (to me more clear I don't want a chopped of image at the top).
The clipping limitation is, as I understand it, caused by the fact that Gideros currently uses OpenGL 1.1 rather than 2.x. One of the reasons @atilim has chosen to stick so long with this version is that it runs on a wider range of older mobile devices. I believe the move to OGL 2.x is well under way and, hopefully, this will resolve a number of issues, including clipping. But even so, Gideros is a very capable system and given it's 2D gaming target market the clipping issue is not that serious (although I'll be very happy when it is addressed).
As I mentioned above, you can make my BhItemSlider appear to be "masked" (sort of) using the setDisabledAlpha() option to fade out the items. If that look is not what you want, it's pretty flexible. You can intercept the scrolling to hide and show elements. Try adding the following code to display the current item near the top of the screen and to only show the first 5 elements after the selected one.
This looks pretty great. I have one strange issue. Set position seems to be off for the slider. The x works as expected but the y seems to be off by 1/4 of the image in the positive. For example if my sprites are 400px high I have to use setPostion(0, 100) to get it to put the top left in the top left of the screen.
just noticed that momentum doesn't work when swiping up and only works when swiping down.
The issue with momentum not working when swiping up seems to be becuase of the "main.min" on line 426. With that removed it works just fine.
If DEFAULT_ITEM_PADDING is not set to "0" (default is set to one). Everything will move off by a slight amount every scroll.
Yes, it looks like you have spotted a couple of bugs, so thanks for that:
1) Momentum scrolling in the reverse direction wasn't working correctly. You shouldn't just remove that math.min() call although that is certainly the line at fault. Fixed in repo version.
2) The item padding is all screwed up. I've never noticed because I always set it to zero. It's pretty redundant (you can space the items out by increasing the itemWidth or itemHeight parameters) so I have removed it completely. You should find that this fixes the positioning issue you mention above.
I've added BhItemSlider to my GitHub repositories. You can find the latest version (including fixes) here.
Check out the the other libraries too. They are discussed in my blog.
But I've a problem with this Class than with Ace.Slide.lua I hadn't it. I don't know if you can help me a little with this.
In Ace.Slide.lua (earlier version) I could do the next dirty trick:
Thanks again for your time
Thanks again for your time