Issues retrieving parallax x/y factors from a TiledLayer
Closed this issue · 12 comments
While being able to retrieve other layer properties from my TiledLayers strangely enough TiledLayer.layer.parallaxX/Y have both always returned 0 for me, which is strange since the default values of the parallax scrolling factors are set to 1. Inside of my .tmx map file I can see the parallax scale factors set for each of my layers and it seems to be correct
Hey
Thanks for reporting! I will have a look at it.
With kind regards,
TheBoneJarmer
Hey
I just learned that I wrongly mapped the parallaxX and parallaxY attribute. Fucked that one up pretty good ghehe. Made a patch and hopefully within a few minutes the new NuGet package is available. :D
With kind regards,
TheBoneJarmer
The fix seems to be working slightly, I was able to retrieve the parallax factor from only one of my layers though, which was (2, 2). My layers with decimal factors don't seem to be working, and my layers with the default parallax factor of (1, 1) return (0, 0), I'm gonna assume this has something to do with the .tmx files not including parallax values for each layer if they are the default (1, 1), so maybe have TiledLayer.parallaxX/Y have a default of (1, 1) this way nobody has to multiply their parallax camera shenanigans by (0, 0). Appreciate ya taking the time to fix this :)
Oh fuck me haha, was not even aware of that. My apologies! And thank you for letting me know! You were correct about your assumption. The default is indeed 1,1 but is not saved until it gets changed. Well spotted. I will correct that and send a new patch on your way. :)
The new NuGet has been published in the meantime. The new version is 3.2.3.
Hey
Glad to hear!! And thanks for pointing that one out. I made some changes on develop just now that fixes that, added support for the class attribute on a layer (heck, never knew it was possible lol) and done rid of some warnings. I'm cool with releasing another patch but if you don't need this asap I'd rather wait till I got a bunch of stuff again. D:
With kind regards,
TheBoneJarmer
A quick patch would be greatly appreciated around now but I understand that releasing small tiny minimal patches with very little changes isn't ideal, your call.
Than I'll do it. I was not sure you meant you just noticed or that you actually needed it right now. But it seems the latter is the case. Hence I just pushed out a new release. I already got a notification from TeamCity that the build succeeded so within a couple of minutes the NuGet package should be available. :)
Mind you, it is not a patch this time but a minor release because I changed the property type string to an enum as requested by someone else. You might need to change that as well.
Hey @Frankfires
Just to be certain, you mentioned things work flawlessly in the other issue. Does that mean this one is solved for you as well?
With kind regards,
TheBoneJarmer
Yes, I am now able to retrieve parallax values from image layers, thanks for the fix :D
Awesome 😎