Android Question lgMapAnimatedTiledMapTile

coldteam

Active Member
Licensed User
Longtime User
Hello,
i try to use Tiled Map Editor - Animation Editor
add animation at layer 'ANIMATIONS'

in code:
B4X:
Layer_ANIMATION = TiledMap.Layers.Get2("ANIMATION")

in render:
B4X:
Renderer.renderTileLayer(Layer_ANIMATION)
but Tile stay frame = 0(without animation)

i read about func: AnimatedTiledMapTile.updateAnimationBaseTime();
but cant find it in B4A LibGDX
 

coldteam

Active Member
Licensed User
Longtime User
if i use
B4X:
Renderer.Render
it works, but i want draw layers like
B4X:
Renderer.renderTileLayer(Layer_ANIMATION)
 
Upvote 0

coldteam

Active Member
Licensed User
Longtime User
ofc i do it, but animation stay frame - 0
now i do like this:

Dim inta(1) As Int
inta(0) = 5
Renderer.Render2(inta)

if i try
Renderer.SpriteBatch.Begin
Renderer.RenderTileLayer(Layer_ANIMATION)
Renderer.SpriteBatch.End
dont work
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Yes, I see the problem in the Java code. When Render calls all specialized Render functions, it begins with a call to updateAnimationBaseTime. This function is in my code but not made public in the XML file of the library. You have to call it with the JavaObject lib (JO = yourAnimedMapTile, JO.RunMethod("updateAnimationBaseTime", null)) before calling RenderTileLayer.
Sorry for the inconvenience. It seems that the bug is also in the original lib.
 
Upvote 0
Top