Closed Quillraven closed 6 months ago
Unfortunately, the
beginRender()
andendRender()
methods of theOrthogonalTiledMapRenderer
are protected, which means we cannot call them directly.
There's a cheesy way to get around this. Create a separate Kotlin file, set the package to match OrthogonalTiledMapRenderer
(with a warning suppression that is doesn't match the folder structure :wink:), make utility functions or extension methods that call the beginRender()
and endRender()
, and finally use those in the use
extension. This would call any overridden methods.
Unfortunately, the
beginRender()
andendRender()
methods of theOrthogonalTiledMapRenderer
are protected, which means we cannot call them directly.There's a cheesy way to get around this. Create a separate Kotlin file, set the package to match
OrthogonalTiledMapRenderer
(with a warning suppression that is doesn't match the folder structure 😉), make utility functions or extension methods that call thebeginRender()
andendRender()
, and finally use those in theuse
extension. This would call any overridden methods.
I did that trick now. Did not know about it and feels weird that this is even possible :) But a nice solution imo for this scenario.
@Quillraven I missed that you've set the master
as the target branch instead of develop
. Can you set another PR to the develop
branch? Sorry!
PR for #479
Unfortunately, the
beginRender()
andendRender()
methods of theOrthogonalTiledMapRenderer
are protected, which means we cannot call them directly. I never needed a custom renderer or had to override those methods. Also, they seem to never change in recent LibGDX versions. That's why I think "copy&pasting" their content is fine in this case. However, I still added a remark in the ReadMe.md that this can be a potential issue.If you have a problem with it then feel free to remove those extensions :)