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 - tomitukiainen

Pages: [1]
1
Thanks! Problem solved :)

2
Hello,

we have released a game that displays Facebook name of the player and her friends in ranking lists. We support most important character sets in our tk2d bitmap font but we have already a few players whose name we can't render. Most of the time unsupported glyphs are rendered empty (as we saw in testing phase) but name of one of our players causes the following exception to happen:

I/Unity   (19151): NullReferenceException: Object reference not set to an instance of an object
I/Unity   (19151):   at tk2dTextGeomGen.GetMeshDimensionsForString (System.String str, .GeomData geomData) [0x00000] in <filename unknown>:0
I/Unity   (19151):   at tk2dTextGeomGen.SetTextMeshGeom (UnityEngine.Vector3[] pos, UnityEngine.Vector2[] uv, UnityEngine.Vector2[] uv2, UnityEngine.Color32[] color, Int32 offset, .GeomData geomData) [0x00000] in <filename unknown>:0
I/Unity   (19151):   at tk2dTextMesh.DoNotUse__CommitInternal () [0x00000] in <filename unknown>:0
I/Unity   (19151):   at tk2dUpdateManager.FlushQueuesInternal () [0x00000] in <filename unknown>:0
I/Unity   (19151):   at tk2dUpdateManager.FlushQueues () [0x00000] in <filename unknown>:0
I/Unity   (19151):   at tk2dCamera.OnPreCull () [0x00000] in <filename unknown>:0

We have planned to implement a workaround: we want to render the text with a system font when it contains glyphs that we don't have in our bitmap font. Can you tell us how we could identify this situation? Pseudo code:

--
Code: [Select]
public tk2dTextMesh tk2dText;

void SetName(string playerName) {
 if(tk2dText.HasUnsupportedGlyphs(playerName)) {
   // render name with system font
   ...
 } else {
   // all glyphs supported -> render name with tk2dTextMesh
  tk2dText.text = playerName;
  tk2dText.Commit();
 }
}

3
Sorry to hear ;)

I found the old functionality really useful for sorting sprites in my characters. When you define 2d characters hierarchially, ordering by minimal changes in Z position is not very convenient as it requires you to make a bit of calculations to get the overall ordering right when using local coordinates. For example, my wizard is composed like this (layer order before name):

1: Torso
5: -> Head
0:  |- Hat
4:  |- Beard
6: -> Left Hand
2: -> Right Hand
3:  |- Stick
 
But yep, I'll take the most compatible route and swap back to calculating Z positions to get the ordering right. Just note that your documentation of SortingOrder function is now out of date.

Thanks for the fast reply!

4
Hello,

I just updated from toolkit version 2.2.x to 2.3.0 and distant objects started to appear on top of closer ones. It seems that 'Order in Layer' definitions in my tk2dSprites might be causing this.

I've used this ordering feature to define which sprites are drawn on top of each other when they have the same Z-value. For example right hand and right leg of a zombie have higher value than torso, so that they appear on top. 

This has worked fine with the old version. Now it seems that sprites with higher 'Order in Layer' value are always drawn on top of sprites with lower value, even when they are not on same Z. Actually the overdrawn sprites can be a lot closer to the camera. 

--
int SortingOrder [get, set]: Gets or sets the sorting order The sorting order lets you override draw order for sprites which are at the same z position. It is similar to offsetting in z - the sprite stays at the original position. This corresponds to the renderer.sortingOrder property in Unity 4.3.
--

Attached is a screenshot where you can see the problem and 3d version of the same scene. Sorting order of zombie left hand is zero and they are not drawn on top of the menu window but other parts with higher sorting order are (altough they're some 5 units deeper in the scene).


Best regards,

Tomi Tukiainen

Pages: [1]