Hi !
Another newb question. :-S
I'm using movieClip to add some FX when the player touches some items of my game.
I have a lag problem (only on device) on the first touch event. The animation takes something like 0.5s to display. After that, everything is ok.
Is there a way to "preload" the graphic elements and avoid that delay ?
thks
My meditation plan :
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
Comments
So it will be loaded before and your animation will work without delay.
"init.lua" is a special file that gideros will automatically run that file before every lua file.
If you have so many asstes to load you can even create a preloader image like described in this tread.
http://www.giderosmobile.com/forum/discussion/comment/9755
And yes preloading graphics can also help. Usually I create a texture pack with all the graphics needed for specific scene. Then I load the pack when scene loads, thus all graphics will be preloaded before using them
I'm trying to produce a basic example to show you my problem.
@ar2rsawseen: I'm not using Texture Packer. As I'm familiar of graphics software, I'm using sequences of images. I'm going to try Texture Packer to see if I obtain better efficiency
I have created a specialFX class. In the specialFX.lua, I have lot of framelists (which are sequences of 25-30 png files each).
How can I preload these files ? What is the code I need ?
Sorry, I'm really novice with all of that (and have to explain in english doesn't help)
thx
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
Likes: jimlev
Here is an example project to show my problem.
Though I created it from scratch using part of Gideros examples, it shows my delay problem (only on device).
When you touch the screen for the first time, the animated mc takes something like 0.5s to be displayed. Next instances don't have the lag pb.
While making that simplified example, I also note that my first instance stop looping when the second one is created... I really think I still have a lot to learn...
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
The same effect is from packed textures
Likes: jimlev
You're right, it solves the latency problem...
though, it adds a new problem.
By creating the sprite that way, there are three new issues :
- the sprite's sequence doesn't start (dis)playing at the first image of the sequence (easily seen with local player at 15fps rate)
- all instances of the sprite are synchronised (same images of the sequence are displayed at the same enterframe event)
- everytime the event is triggered, all the instance of the movieclip (mcAnimatedSprite) restart from start
( snif
but I have to admit you solve the lag pb :-\"
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
Really thanks, your help was appreciated.
I have to learn a lot more, to avoid all the traps I create myself, by lack of knowledge
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔