czyzby/gdx-lml

Support for different units in width/height

rcdvl opened this issue · 3 comments

rcdvl commented

Hello, do you have any plans to include support for custom units in the width/height or even positions of actors?
I'm implementing a game with a pixel-perfect UI viewport, with actors' sizes defined in DPs (like Android) and this would be pretty useful for me and maybe for others.

No, I don't actively develop new features in LML if their scope is too big, sorry. If anything, I currently focus on KTX.

Numbers you use in your LML files translate directly into your Stage's Viewport units - these are not pixels, unless the viewport treats it as so. I don't think adding units on top of that would be easy to implement, since every viewport would interpret them in a different way. You might want to play around with Viewport implementations and see if anything fits your needs.

rcdvl commented

Actually right after opening this issue I figured a way to do this without changing the lib's code. Instead of placing DPs in sizes and positions it should be easier to make the viewport size in DPs by calculating this on resize(). Anyway, thank you for the libs.

That's great. Anyway, if you have any problems with the library (or some small feature requests), don't hesitate to create new issues.