Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - grit

Pages: [1]
1
Support / Textures used in Sprite Collections always Read/Write Enabled?
« on: December 03, 2014, 10:32:56 pm »
Dear TK2D team,
I just noticed that in the import settings of my textures I use in sprite collections, I cannot disable the Read/Write Enabled flag. I use the "Advanced" texture type. I wonder why this is and if it has a bad side effect, because I read that enabling this, means that for every texture a copy is created in memory. Is this the case and if so, how can I avoid this?
Kind regards.

2
Support / Sprite textures get destroyed during run time?
« on: June 27, 2014, 07:02:47 pm »
I have a problem with sprite collections being destroyed in a scene, at least it seems that way, in combination with another plugin "LiveTexture" by prime[31]. However, I think the problem is on this side, so I try to find a solution here first. The problem occurs on my iOS devices in release mode – not in debug mode, though.

More details – sorry if the description gets quite long, but I want to make sure, you understand what is happening. (Also I am just a beginner in Unity):

I have a rather simple 2D scene with some tk2d sprites, all sharing one sprite collection – and a plane for showing a cutscene first in front of the whole scene. Via scripting I load a video texture (a video file) into the material of the plane when the scene starts. (All that is done using that other prime[31] plugin.)

As soon as the video finishes, I hide the video plane – and here comes the problem: In release mode (development build turned off) all the tk2d sprites now have the video texture or parts of it applied to them – as if the sprite collection, they are supposed to use, is not available any more. This does not occur, when I build for development. I guess, this is because the sprite collection is not unloaded then. (?)

However, I played around a bit, to find out, what's going on. I want to share three observations:
1) The problem does not appear with Unity Sprites. They all look fine, but I just switched to tk2d, because of the better 2D handling and more flexible asset management.
2) If I add a Unity Sprite to the scene and assign the atlas to it, that the other tk2d sprites are using as well, the problem does not appear any more. I  assume, the Unity Sprite prevents now the sprite collection from being destroyed. (This is my actual work around right now, but it is obviously not how it should be solved.)
3) If I add a tk2d Sprite with a tk2d Sprite Animation to the scene – also using the same shared sprite collection as all the others – I see that the sprite collection is gone for a wink after the video is done, and comes back when the animation jumps to the next frame, as if it retrieves the sprite collection back into the scene.

PS: I know, I should always try to limit the assets. The scenes I have right now are really small, sometimes just a handful of sprites using a 1024 x 2048 atlas alltogether. The video files range from about 5 MB to sometimes 25MB, but the problem appears with all of them. The video texture is loaded from the StreamingAssets folder btw, in case this is of importance.

Thank you in advance for help and suggestions.

Pages: [1]