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

Pages: [1]
1
Support / Using sprite collection on a big group of assets?
« on: December 09, 2013, 10:34:19 am »
Hi,

I'm making a game which is akin to a Visual Novel. It's a kinda interactive dialogue thing w/c shows character sprites talking to each other.
See this sample (taken from Little Busters!):


As you can see there are two character sprites displayed on screen. The catch is, I have a lot of character sprites w/c are actually pretty big (800x800 or bigger) and each character also has a sprite w/ a different emotion face. I currently have 28 characters with 5-8 emotion variations each, and each emotion variation is also a 800x800 image.

Now the dialogue part isn't hard coded, in fact it's in an XML script w/c dictates what text to display and what sprites to display (or change).

My question is: Would it be practical to use a sprite collection w/ multi atlas enabled? So that whenever I want to switch sprites, I simply change the spriteID of the current/prefab sprite.

Or should I make a sprite collection for each sprite (or maybe group them to fit 2048x2048)? Doing so would be very cumbersome when the game is running because I will need a code to find the sprite collection of any sprite I would want to display.

Do all the atlases on a sprite collection get loaded once you use even 1 sprite from 1 atlas from that collection?

I don't think draw call will be a problem here because at the moment I have less than 10 in any given time during gameplay.

2
Still throws an exception

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
tk2dTextGeomGen.GetMeshDimensionsForString (System.String str, .GeomData geomData) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextGeomGen.cs:78)
tk2dTextMesh.GetEstimatedMeshBoundsForString (System.String str) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:505)
FoodDetailUIController.UpdateDisplay (UnityEngine.GameObject itemGo) (at Assets/Scripts/UI/ItemMenus/FoodDetailUIController.cs:141)
FoodDetailUIController.set_Item (UnityEngine.GameObject value) (at Assets/Scripts/UI/ItemMenus/FoodDetailUIController.cs:30)
FoodDetailUIController.Update () (at Assets/Scripts/UI/ItemMenus/FoodDetailUIController.cs:61)

3
Forgot to put a more informative description, here's the error:

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
tk2dTextMesh.FormatText (System.String& _targetString, System.String _source) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:124)
tk2dTextMesh.FormatText (System.String unformattedString) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:114)
tk2dTextMesh.GetEstimatedMeshBoundsForString (System.String str) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:504)
FoodDetailUIController.UpdateDisplay (UnityEngine.GameObject itemGo) (at Assets/Scripts/UI/ItemMenus/FoodDetailUIController.cs:141)
FoodDetailUIController.set_Item (UnityEngine.GameObject value) (at Assets/Scripts/UI/ItemMenus/FoodDetailUIController.cs:30)
FoodDetailUIController.Update () (at Assets/Scripts/UI/ItemMenus/FoodDetailUIController.cs:61)

4
Hi,

I recently migrated to 2DToolKit 2.3, upon migration I found the the following parcel of code doesn't work

Code: [Select]
// Get estimated bounds of a string and add half of it to visible area for additional padding
tk2dTextMesh effectText = EffectPrefab.GetComponent<tk2dTextMesh> ();
Bounds textBounds = effectText.GetEstimatedMeshBoundsForString ("[-1 Fire to Elemental Attack]");

This parcel of code was previously working with 2DToolKit 2.2

I've replaced it with an instantiated game object and it seems to work fine
Code: [Select]
GameObject sampleEffectTextGo = (GameObject)Instantiate(EffectPrefab);
tk2dTextMesh effectText = sampleEffectTextGo.GetComponent<tk2dTextMesh> ();
Bounds textBounds = effectText.GetEstimatedMeshBoundsForString ("[-1 Fire to Elemental Attack]");
Destroy(sampleEffectTextGo);

One thing I've noticed is that the MeshFilter doesn't have a mesh when it's a prefab, however when instantiated it does have one.
Any ideas as to why this is happening?

5
Support / Re: Multiplatform strategy?
« on: August 30, 2013, 02:32:48 pm »
Apologies, I failed to read the Platform Specific Sprite Collections documentation before hand.

A few additional questions, the 1x 2x option works for SpriteCollections with the same name but different configuration? So I should be making a CharacterPortraits@1x and configure it to the 1x platform. Then add another CharacterPotraits@2x and configure it to 2x platform, and both spritecollections must be in the same directory somewhere in my projects folder. Is that correct?

How do you support an iOS build having both iPad and iPhone specific assets?
How do you support a build that has both iOS and Android assets inside?

Ty!

6
Support / Multiplatform strategy?
« on: August 30, 2013, 02:20:47 pm »
Hi,

I'm currently making a game aiming to support multiple resolutions on iOS and Android. The game is UI intensive so it's not a simple reposition this sprite everything works.

I'm predicting I will have multiple atlases for different platforms (e.g. iPad Retina vs iPhone Retina) as the UI assets will be different, as well as having atlases for Android platforms as well (1920x1080, 1280x720, 800x480, 1024x768, etc.).

I'd like some advise on how to tackle this correctly as I'm still in the early development stage. Should I attach scripts that swap out sprite collections on runtime? How about positioning and scaling?

I was thinking having spritecollections named like:
CharacterPotraits@iPhoneHD
CharacterPotraits@iPadHD
CharacterPotraits@AndroidSmall
CharacterPotraits@AndroidNormal

But I think if I publish a build for say iOS only, the Android atlases will also be included in the build. Is that correct? Is there a way to avoid this?

7
Support / Re: Scaled down text mesh looks blurry
« on: August 30, 2013, 12:39:20 pm »
Thanks for the quick response. I'll try those!

8
Support / Re: Scaled down text mesh looks blurry
« on: August 30, 2013, 12:25:41 pm »
But then I won't have gradient options, w/c I'm using for some of my fonts. I think I'll just import another font and try to budget the file size (it isn't that big anyway). Will there be support for gradient options for fonts in a sprite collection in the future?

Another question: I'm using GylphDesigner to add drop shadows to my fonts as well, so I usually use 2 variations of fonts with the same size, one with drop shadow and one without. As far as I know there aren't any features like this in 2d tool kit, any plans of supporting in the future?

9
Support / Scaled down text mesh looks blurry
« on: August 29, 2013, 01:59:07 pm »
Hi,

I'm currently developing a game for the iOS. My Unity player has not switched platforms yet so I'm using PC standalone configuration.

The thing is, exporting a 64px font size from Glyph Designer and scaling it down to 50% looks blurrier than a 32px font size exported w/ the same settings. Is there a way to make this match the 32px quality w/o making another tk2dfont (hence not taking up another image w/ file size). I've already set the font texture to Automatic True Color, Filter Mode: Trilinear

I can post images if needed. Ty!

10
Support / Re: ScrollableArea disable while touching
« on: July 25, 2013, 03:04:16 pm »
Applied your code fix, works now. Thank you!

11
Support / ScrollableArea disable while touching
« on: July 25, 2013, 06:15:34 am »
Hello,

So I'm trying to code something like dragging an item out of a scrollable area. What I do is if I touch something in the scrollable area for more than 0.5 seconds, I disable the scrollable area and create a new "fake" object to drag around the screen. After releasing that object (touch up or mouse button up), I re-enable the scrollable area.

I think I've found a bug.

When a touch is active (i.e. i'm currently scrolling it) then I disable the tk2dScrollableArea script. The variable
Code: [Select]
isSwipeScrollingInProgress is still true. However on the
Code: [Select]
OnDisable() method, you unsubscribe to OnInputUpdate via
Code: [Select]
tk2dUIManager.Instance.OnInputUpdate -= BackgroundOverUpdate;
So next time I enable it it won't register to the to the line
Code: [Select]
tk2dUIManager.Instance.OnInputUpdate += BackgroundOverUpdate; in
Code: [Select]
BackgroundButtonDown()
So when I enabled it, it won't scroll anymore.

Is this a bug or is this intended behaviour? Please advise, thanks!

Pages: [1]