Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17076

Prefab - dynamically creating sprite

$
0
0

@alxlozano wrote:

Hi, looking to get feedback from the community on best practice to allocate a new sprite in the following scenario. We have a pre-fab that models a block and inside is to have an sprite that is to be loaded through code as per game rules.

I noticed in some samples that the scripts declare a dynamic array of sprite-frames and from there logic picks the sprite frame for the sprite. Does this type of declaration impact memory usage, for instance assume you have 100-200 entries available for the sprite

or

in a case like this is it better to declare a string variable to capture the name of the image and load dynamically in code. I tried this approach and get consistently image not found.

Feedback is appreciated

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>