Skip to main content
V.H
Senior
Oct 25, 2021 12:45 AM UTC
Question

AnimatedImage can not work

I add three AnimatedImages in a screen, but only one can work normal.

I transplant 'Knight Hits Zombie Game' code and bring my own project, the Zombie and Head AnimatedImages can not play but the Knight AnimatedImage work normal. (The Zombie and Head show the first image but can not show the others).

This topic has been closed for replies.

18 replies

V.H
V.HAuthor
Senior
Oct 25, 2021 6:42 AM UTC

Solved.

Romain DIELEMAN
ST Employee
Oct 25, 2021 9:15 AM UTC

Hi,

​

Good to hear it works :thumbs_up:. What board were you using ? What was the issue and the fix ? Was it due to an issue with the external flash loader ?

/Romain

V.H
V.HAuthor
Senior
Oct 25, 2021 9:23 AM UTC

​I ported the program to my own board used 320 * 170 touch screen.

I close the timestamp and the random function cannot work. (CortexMMCUInstrumentation.cpp)

DNguy.14
Associate II
Mar 6, 2023 9:51 AM UTC

Where can I get the source code of Knight Hit Zombie game?

V.H
V.HAuthor
Senior
Mar 7, 2023 12:12 AM UTC

Used "TouchGfx Desinger"​ could generate the source code of Knight Hit Zombie game.

DNguy.14
Associate II
Mar 7, 2023 10:20 AM UTC

Hello, I use Random function in Utils.hpp but it's always return the same value. Can you help me?

class Utils
{
public:
 static int randomNumberBetween(int lowest, int highest)
 {
#ifdef SIMULATOR
 return (int)(lowest + (highest - lowest) * (rand() / (float)RAND_MAX));
#else
 uint32_t random = (touchgfx::HAL::getInstance()->getCPUCycles() * HAL::getInstance()->getCPUCycles());
 return lowest + (random % (highest - lowest));
#endif
 }
};

DNguy.14
Associate II
Mar 7, 2023 7:25 AM UTC

Thanks you, I don't know it's an example already available in ToughGFX.

Romain DIELEMAN
ST Employee
Mar 7, 2023 7:28 AM UTC

Hi,

You can find it in the Demos tab in TouchGFX Designer.

0693W00000aILftQAG.png 

/Romain

DNguy.14
Associate II
Mar 7, 2023 8:15 AM UTC

Thanks you, I got it.