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.


Messages - grit

Pages: [1]
1
Support / Re: iPhone 6 and iPhone 6 Plus screens
« on: May 20, 2015, 06:42:18 am »
I see.
I just wanted to make sure, that there is no other function I could call to get the numbers I expected.
Thank you,
Grit.

2
Support / Re: iPhone 6 and iPhone 6 Plus screens
« on: May 18, 2015, 01:17:41 pm »
Hello,

I can confirm zeitweise's post: When I call

tk2dCamera.Instance.TargetResolution

I get 1242 x 2208 from the iPhone 6 plus iOS simulator and 1080 x 1920 from the device (physical pixels).

This is problematic for the positioning of my interface elements on the screen, as I am calculationg with 1242 x 2208. Is there a way to get the render resolution (1242 x 2208) from the device as well or do I have to hard code the numbers (physical resolution / up scaling) in my code for placing my interface elements?

Kind regards.

3
I see, thank you very much.
Best, Grit.

4
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.

5
Support / Re: Sprite textures get destroyed during run time?
« on: July 04, 2014, 01:10:11 am »
Well, maybe I will find some time to write a more clear report to unity describing this as a simple-to-reproduce-step-by-step-example.
In the meantime I use my workaround.
Nevertheless thank you very much for your kind support.  :)

6
Support / Re: Sprite textures get destroyed during run time?
« on: July 03, 2014, 08:58:27 pm »
It is me again. ;)

I just couldn't stop the investigations and now noticed something!

Actually it seems the navi buttons HAVE something to do with the problem, but in another way as I thought of:
Because what just happened was: By "reconstructing" my scene I made a mistake and assigned the button textures from the wrong atlas to the navi buttons, means they now didn't use the same material as the other sprites of the scene any more. Now after the video finished or was interrupted the sprites all looked correct. The same is the case, when I don't have navi buttons at all. (The two navi buttons sit in front of everything all the time: during the video is playing and afterwards in front of the other sprites as well.)

Is it possible, that in the moment, the video is done or interrupted = texture killed, that the system sweeps all the stuff from memory, that is just visible in front of the video plane, and thus destroys the material of the navi buttons? Well, this would probably be a question for prime[31].

I still wonder, why this should be the case. Also why this is not happening, when there is a unity sprite with the relevant texture hanging around somewhere "behind" the scene.

Another thing I observed: The materials get indeed not messed up that often, when I let the video finish itself instead of interrupting it. I should address this to prime as well.
Still everything quite obscure to me.

7
Support / Re: Sprite textures get destroyed during run time?
« on: July 03, 2014, 07:47:37 pm »
... I just made a new build, with the scene reconstructed as it was before – without any "workaround" – and now I see no problem with the materials.
I am confused and I guess you, as well. Sorry.
I think I should have a fresh look at it again later to proceed more analytically.
Argh.

8
Support / Re: Sprite textures get destroyed during run time?
« on: July 03, 2014, 07:27:13 pm »
Ah! :o I think I was guessing too quickly: I built the navi from scratch again (tkUIItems like the control prefabs in your package >> Basic >> BasicButton).
Same happens.
(Just learned the "find reference" thing is not weird, but just because the button's target is the tk2dCam which refers to the video plane. Ha.)
I noticed, if I play the video to the end (have no other choice when I don't have navi buttons any more ;) ) it does not happen (or rarely happens?). When I interrupt the film by using my forwards button, it happens (more likely?). I wonder why, both events (film finishes and pressing forwards) trigger the same function – this would be a question for Mike.
Also unfortunately concerning the unity plane test: I was stupid: When I did that first test some days ago, I assigned another (a third) material by mistake to that plane. That one shows the flickering (don't understand why is that, but maybe not of interest now?). When I assign the material used by the other tk2d sprites as well, it looks fine with or without old or new navi buttons. Sorry for the confusion.

Maybe a problem is also the memory? I am testing on my iPad 1 and I get a lot of memory warnings.

9
Support / Re: Sprite textures get destroyed during run time?
« on: July 03, 2014, 05:46:29 pm »
Hmm, all my tk2d sprites in the scene use the material, that was generated by creating the sprite collection atlas, called "atlas0 material.mat" (see pic1).
The video plane has its own material, called "video.mat" (see pic2).

However, I don't understand following: When I choose "find references in scene" in the context menu of the video.mat, the results also include my navi buttons, which are just tk2d buttons using the same material as the other tk2d sprites in the scene (see pic3). The video plane should be the only object in the scene using the video material. Why do the buttons show up there as a search result?

...
Because I found this weird now, I just did another test: I deleted the navi buttons from the screen – et voilà: The sprites look fine now after the video finishes. Also I did the test with displaying the unity plane again and now it looks totally fine.

Looks like, my navi buttons do something bad here. Do I overlook something? Can there be a problem, because the sprites are instances of prefabs? (The navi button prefab refers to yet another material.)
Or is it even possible, that there happened something weird by reassigning materials now and then when I tested a lot of stuff before? Maybe it helps to build the navi buttons from scratch again? I will give it a shot now...

10
Support / Re: Sprite textures get destroyed during run time?
« on: July 01, 2014, 10:37:55 am »
Thank you so much!  :)
It is very handy, that you know him.
I am lookng forward to hear what you find out.
Kind regards.

11
Support / Re: Sprite textures get destroyed during run time?
« on: June 30, 2014, 05:02:56 pm »
I added a plane with the atlas material of the sprites to the scene, as you suggested, and put it in front of the movie plane.
While the movie is playing, the material of that plane looks as it switches all the time very fast between the sprite material I put on it and the movie material! (However, I logged the name of the assigned texture in Update() and it keeps saying it is the right one.)

Also I just had the idea of shifting the movie plane to the side so I could actually see what happens to the tk2dSprites behind the movie while it is playing: The sprites look fine all the time, just until I stop the movie / the movie finishes: Then they have the movie texture on them, as described before.

I have no idea what is going on here.
As a workaround I can put a Unity sprite somewhere hidden or use the GUI.DrawTexture idea somewhere outside the screen. But still, this is not very elegant.

12
Support / Re: Sprite textures get destroyed during run time?
« on: June 30, 2014, 02:30:36 pm »
Thank you for the quick reply. Unfortunately, the ForceBuild() call does not fix the issue.
I double-checked, if my tk2dSprites are really collected into the allSprites array. Here my code snippet (I use JS, but that should not make any difference, should it?):

      var allSprites : tk2dSprite[] = FindObjectsOfType(typeof(tk2dSprite)) as tk2dSprite[];
      Debug.Log("Please repair: " + allSprites.length);
      for (var spr : tk2dSprite in allSprites) {
         spr.ForceBuild();
         Debug.Log("This is sprite called: " + spr.CurrentSprite.name);
      }

More suggestions are highly appreciated.

13
Support / Re: Sprite textures get destroyed during run time?
« on: June 29, 2014, 10:00:46 pm »
Thank you for the quick answer. I did what you suggested and displayed the texture via GUI.DrawTexture on the screen. It looks totally fine – and at the same time the tk2d sprites look fine as well. But only when I do this. Is it possible that the GUI rectangle now holds the texture in memory? Or do you have another idea, what is happening?

Also, could you give me a hint, please, how I can rebuild all sprites by scripting?

Kind regards.

14
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]