Hey,
I'm using the Lua Ace.Slide class (link below) = (great work! thanks for sharing). It works great, but I'm trying to use the same class for multiple scenes, each needs a unique configuration.
I see the Ace.Slide:init(config) allows for a configuration table to be passed in. The examples using this class pass '{parent=self}' in as the parameter. As the Ace.Slide class provides a default config table, I figured the {parent=self} was some way of using this default. When I pass in my custom config, for any given scene, it displays fine, however when changing scenes, the sprites/buttons added to the slider aren't removed with the scene transition, they remain.
Now, I assume after reading what I could find in the documentation, it's because these sprites haven't been attached to the scene.
Can someone explain to me what's happening with the {parent=self} parameter and help me figure out how to pass in my own configuration table, pretty please!?
I've tried adding my own table as a second parameter which doesn't work.
Link:
http://appcodingeasy.com/Gideros-Mobile/Gideros-Mobile-Game-Template (see file Ace.Slide.lua)
Sample Call: AceSlide.init({parent = self})
Many Thanks!
Comments
That was the first version I wrote, there is now a newer one that uses Gidros class system, thus you can create different instances with different configurations:
https://github.com/ar2rsawseen/AceSlide_oop
https://github.com/ar2rsawseen/GameTemplate
I found your template, I think, through the Gideros Academy - perhaps some nice mod can update the links on there to point to your new work??
I am now using your new OO slider class and have it working well.
There is one final issue I'm having... If the down and up button images are different and a slider touch origin is over a button and a slide is made, the down state of the button gets stuck (the down image is displayed) although the button never "fires" its touch event.
In order to clear the down image the button needs to be touched again. If you want to press the button, it must then be touched once more (i.e. once to clear the down image, once to press the button, if that makes sense).
I've spent an hour or so looking into it, and I believe its probably an integration issue with your Slider class and the standard button class, not with the slider itself. I've not been able to come up with a solution yet. Any chance you could take a quick look and advise?
Many Thanks
BW
There was a function called falseButtons which removed the focus from buttons, and I remember I did everything the same with OOP AceSlide, don't know why it does not work, let me investigate that more
Any luck on a solution? Eagerly awaiting your new version here...
So I was still seeing the problem. I played around with it for a couple of hours, but I started to get some strange behavior with my messing, so I backed it all out.
I've attached a file to demonstrate the issue that I'm seeing. It's your latest tip with a couple of minor changes:
1/ I use a custom button class that instead of using an over image, it darkens the button when buttonDown
2/ Amended main.lua (line 18) to use the button rather than the image.
While preparing this package, I noticed one potentially significant difference (on line 18). I have been adding a button to the slider. You're adding a bitmap.
I will try and see if that fixes it. It would however be nice if we could apply a button though and get the buttonDown effects.
Cheers!
I've also updated the repository
I backed out the changes in the function 'onMouseUp' and all is well. Therefore the original onMouseUp function should remain unchanged.
Thanks again @ar2rsawseen!
Likes: ar2rsawseen, Yan