Page 1 of 1
Bug: Animations lag
Posted: 21 Jun 2015, 07:12
by demoix
I really have no idea why when animations turned on game got high lag and every more take like 1-2 second, when with animations off move goes instantly. My phone is Samsung galaxy s5 and no games laging at all, but in this way yes
Re: Bug: Animations lag
Posted: 23 Jun 2015, 09:28
by sva
I know about it. That's why added option for animation on/off. Now I'm trying to find solution of animation lag...
Re: Bug: Animations lag
Posted: 19 Mar 2016, 12:31
by PLAYER_CHAR
In my opinion, that happens because the game redraws numbers every tick and uses text font for this. It will be less laggy if the game render the text into a temporary canvas for the first time and then redraw this canvas to game screen. When the particle effect disappears, you can destroy this canvas.
(Я так думаю, это происходит по той причине, что игра каждый раз отрисовывает цифры и использует при этом шрифт. Когда шрифт огромный, рендерить его долго (вроде как там проверяется для каждого пикселя, закрашивать его или нет), поэтому и лагает. Вместо этого лучше отрисовать на временное изображение сам текст, а потом рисовать уже это изображение на экран. Когда эффект исчезает, можно удалить изображение из памяти. Как вариант, если продолжает тормозить, то можно рисовать среднего размера шрифт на среднего размера изображение, а потом рисовать это изображение, растягивая его до нужного размера)
Re: Bug: Animations lag
Posted: 19 Mar 2016, 15:29
by sva
Thanks for advice. I'm using SurfaceView object for drawing game situation. And unfortunately it has not instruments for displaying such kind animations as this. I think that using frameworks like libGDX will solve animation problem.
