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

Pages: [1] 2
1
So, as Unikron has pointed out,
The issue was that the sprite sheet png only had numbers in it but the text field text had alpha chars only.  :-[

All working now!

Thanks,

Chris.

2
No worries I have just sent the files to the support email.

Regards,

Chris.

3
Support / BMFonts no longer working - exported from Glyph Designer -
« on: October 12, 2013, 05:31:11 am »
Hi all,

I have now been trying for several hours to get a font out of Glyph Designer and into Unity/tk2d.
I have exported a font from Glyph designer as, BMfont (txt) BMfont (xml) and BMfont (binary) -

In all cases the font file (.fnt) can be inserted into the tk2d font and an atlas generated using the png file.

However,
Using the fonts on a tk2dtextmesh does not seem to work>? (they do not appear) :(

I have an older font that I exported a long time ago and it is working - but the original .fnt file says, unix executable type (event though it is .fnt)
Could the 64 by 64 png be too small?
Really I can't see why this isn't working - everything looks right - but the text does not show up in the scene on the textmesh.

Any advice around this would be appreciated.

Regards,

Chris.

4
Support / Re: Most efficient way to have large level -
« on: May 18, 2013, 11:57:50 am »
Ok thanks,

Ill give it a go.
Ideally there will be 250 - 300 sprites for the level and 80 animated sprites for the entities in level.
Have to see how we go with this.

Cheers,

Chris. 

5
Support / Most efficient way to have large level -
« on: May 16, 2013, 10:16:03 am »
Hi Guys,

Loving the 2dtoolkit and developing.
Got a Question about the best way to do large levels.

For the background (grass),
Is it better to have 100 sprites(128 by 128) all lined up like tiles?
Or a single massive sprite( that repeats the texture? )
Or 10 large sprites that repeat the texture?

Also,
Is it worth checking the sprites and setting renderer.enabled = false for those that are off screen?

Would be great to get some ideas on this before I start coding/building.

Cheers,

Chris .



6
Hey so Toggling helped avoid the tk2dAnimatedSprite.LastUpdate from creating a super spike on are occasions -  which is good.
30 Fps and away we go!

Cheers,

Bl.

7
I'm using 1.8 final + patch 3.

Just to clarify from last post -

gameObject.SetActive(false);

But how to make it active again?
Active = False Seems to turn off the object and all scripts - meaning a parent or manager object would be required to set it to active again.

anim.enabled=false;
Also works,
where anim = GetComponent<tk2dAnimatedSprite>();
This one is easy to turn on again.

Perhaps there is another way to disable and enable the animated sprites - Ive been up and down the google but can't seem to find another?

Any advice here is most welcome.

Bl.

8
Hello again-

So I tried deactivating the animated sprites - but once they are deactivated its hard to reactivate them. They disappear. Bam! gone.
I have now deactivated the tk2dAnimatedsprite component for offscreen objects.

This helped but I still get Frame rate spikes.

I have the profiler and the spikes seem fairly evenly spaced every 2 seconds or so.
It says that they are coming from,

The update()  in my script on the animatedsprite object. (with 20 of these its ok) but with 40 it starts to spike.
Physics.Simulate (mainly)
and also, Overhead.

my goal is to have 80 - 100 animated sprites. Interestingly, with 100 there is not that much difference to 40.

So I began playing with the Fixedtimestep and maximum allowable timestep to try and adjust performance.
Setting these low - 0.01 and 0.01 gets a perfect framerate with no spikes but the animation frame rate becomes really slow.

Any advice on where to go from here?  :)
I am thinking of using co-routines but maybe this will not help?

Bl.

9
Cool thanx for the fast response -

interesting about the animated sprites.
So, would there be gains from anim.Stop(); and also renderer.enabled = false, for Off screen animated sprites?
My frame rate is no longer stable, it sometimes drops 1 or 2 or even 5 frames on iphone.  - Trying to stabilise it.

Bl

10
Subject line says it all.
Perhaps Unity is already doing this?

Or is it best to tell unity to not render all those sprites off the screen.

Ive run a test and I cannot see much difference..
anybody else been through this?

cheers,

Bl.

11
Support / Re: Auto detect iphone version>?
« on: December 13, 2012, 12:51:26 am »
Thanks unikron,

Good to know - I also saw someone detecting screen size and then scaling sprites.

Time to rescale everything back to 1!  :)

Cheers,

BL.


12
Support / Auto detect iphone version>?
« on: December 03, 2012, 07:18:20 am »
So I've noticed there is a platform setting in the sprite collections now with 1x, 2x, 4x.
I guess I am wondering how I can reference the one sprite collection/atlas but set this parameter to 1x if iphone 3g, 2x if 4.

Had a look online could not find info.

Is there code to detect iphone version and set sprite collection size multiplier? 

Also, multiplying the size of the sprite sheet will also multiply the positions(coordinates) of objects?

Keen to find out about this stuff.  ;)

Cheers,

BL.

13
Support / Re: Text in a sprite collection not aligning correctly?
« on: October 28, 2012, 03:09:41 am »
OK solved my problem -  ;D

Needed to be referencing tk2dTextMesh - and then commit to update.

this.GetComponent<tk2dTextMesh>().text = FramesPerSec.ToString();
this.GetComponent<tk2dTextMesh>().Commit();

So far so good!

BLue L. 

14
Support / Re: Text in a sprite collection not aligning correctly?
« on: October 25, 2012, 01:15:52 am »
The mystery is solved and it was my settings!  :D
Still a noob at this stuff -

It turns out I had selected the original .png file for the texture map - And not the atlas created tex from the sprite atlas obj. Which is why the texture was misaligned.

I must have set this when I could not see the font at all before I scaled it up in size.

Its now working perfectly thanks for your help!

However, I am now having trouble accessing the text mesh -

Ive tried making the text mesh as the child of the OBJ where the code is being run, and also having it separate as its own object -

But I keep getting,
Does not exist in the current context

or

Type `UnityEngine.GameObject' does not contain a definition for `mytextobj' and no extension method ....

I think there is some confusion for me around variables, scope and syntax for getting and setting -

It is also hard to understand the code examples I have found as the term, "textmesh" is used and I am not sure if this is an instance name or a class name, or something else -

Here are the examples I have been experimenting with -

   var myTextMesh = (GetComponent(TextMesh) as TextMesh);
    myTextMesh.text = "Pls work";


//and from unity script reference -

public class example : MonoBehaviour {
    void Example() {
        GetComponent<TextMesh>().text = "Hello World";
    }
}

Any advice around how to get this up and running would be great -

Thanks,

Chris.

15
Support / Re: Text in a sprite collection not aligning correctly?
« on: October 23, 2012, 10:38:59 am »
Have done,  :)

Cheers,

Blue L.

Pages: [1] 2