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

Pages: [1] 2
1
Support / Re: Multiple language Fonts with Outline stroke
« on: January 06, 2014, 03:26:13 pm »
I got this plugin

http://forum.unity3d.com/threads/187730-Easy-Font

I think its good, since it loads font file & create runtime texture with stroke as well .


2
Support / Multiple language Fonts with Outline stroke
« on: January 06, 2014, 12:25:35 pm »
Hello

We were creating fonts according to http://www.unikronsoftware.com/2dtoolkit/doc/2.00/tutorial/preparing_a_font.html . And it was working great.

Now we need to do localisation for multiple languages and creating font textures for each language is time consuming.
Can you suggest a good plugin which will support ttf, otf fonts. We also need to give font stroke(Outline) and change the colour of stroke  etc. And most importantly it should well with 2d toolkit.

Thanks

3
Support / Re: Too Many Spritesheets !
« on: November 09, 2013, 03:45:48 pm »
Ah Finally after lots of google search & scratching head got the solution .

Create the texture like this
*note you need so give the .png.bytes file through the Unity interface

Code: [Select]
Texture2D runtimeTexture = new Texture2D(1024,768,TextureFormat.RGBA32,false);
runtimeTexture.LoadImage (imageTextAsset.bytes);

If we directly create Texture using new Texture2D (32, 32); it will be blurry.

Then from the texture create sprite like

   
Code: [Select]
tk2dSpriteCollectionSize spriteCollectionSize = tk2dSpriteCollectionSize.Explicit (runtimeTexture.width, runtimeTexture.height);
spriteCollectionSize.pixelsPerMeter = 1;
spriteCollectionSize.orthoSize = 512;

GameObject myTestSprite = tk2dSprite.CreateFromTexture (runtimeTexture, spriteCollectionSize, new Rect (0, 0, runtimeTexture.width, runtimeTexture.height), new Vector2 (runtimeTexture.width / 2, runtimeTexture.height / 2));
myTestSprite.transform.localPosition = new Vector3 (0, 0, 0);


Hope this will be helpful for someone  :)

@unikronsoftware
Thanks :) & Let me know if there is any improvement in the above code.

4
Support / Re: Too Many Spritesheets !
« on: November 08, 2013, 02:45:08 pm »
Hello

I am trying to create sprite from Texture like  , but the size of the sprite is improper . (I guess something to do with pixel meter ?)
Also i saw many methods to create sprite , but all the methods need tk2dSpriteCollectionData  .

Can you tell me what is wrong in the below code or let me know if there is a easier method to create a simple 2d sprite from Texture2D , also i didn't get the point Use the texture from sprite component as I mentioned before, and call Create on it when updating the texture.

               
Code: [Select]
tk2dBaseSprite spriteInstance = null;

Texture2D runtimeTexture = new Texture2D (4,4);
runtimeTexture.LoadImage (imageTextAsset.bytes);

Debug.Log ("runtimeTexture.width" + runtimeTexture.width + runtimeTexture.height);

string[] names = new string[] {
"Full sprite",
};
Rect[] regions = new Rect[] {
new Rect (0, 0, runtimeTexture.width, runtimeTexture.height)
};
Vector2[] anchors = new Vector2[] {
new Vector2 (.5f, .5f),
};


tk2dSpriteCollectionSize spriteCollectionSize = tk2dSpriteCollectionSize.Explicit (runtimeTexture.width, runtimeTexture.height);

tk2dSpriteCollectionData spriteCollectionInstance = tk2dSpriteCollectionData.CreateFromTexture (runtimeTexture, spriteCollectionSize, names, regions, anchors);

spriteCollectionInstance.halfTargetHeight = 0.5f;
spriteCollectionInstance.invOrthoSize = 2.0f;

GameObject go = new GameObject ("sprite");
go.transform.localPosition = new Vector3 (0,0,0);
spriteInstance = go.AddComponent<tk2dSprite> ();
spriteInstance.SetSprite (spriteCollectionInstance, 0);


In-between i also saw a feature called dicing , it works great in saving Atlas space . Whether using dicing in the atlas increased loading time or any performance issue ?

Thanks

5
Support / Re: Too Many Spritesheets !
« on: November 07, 2013, 04:21:51 pm »
Ok Sure . I have filled the form.

Thanks .

6
Support / Re: Too Many Spritesheets !
« on: November 07, 2013, 03:51:53 pm »
Okay i will do that tomorrow .
Is there any restrictions in support request or anything like that ?

Thanks .

7
Support / Re: Too Many Spritesheets !
« on: November 07, 2013, 03:00:33 pm »
Hello

I tries various methods today , and found that .png.bytes file is the best one  :) , If we do this we can save  20 MB for 2048*2048 in RGBA 32 Bit ! Thats huge memory size if we consider its just one iPad Retina Background .

Do you think by doing this , will it effect the loading time of the game or the scene ?

Also which is the best way to create tk2dsprite from the Texture2D ?

Currently i am using code like

Code: [Select]
tk2dBaseSprite spriteInstance = null;

Texture2D runtimeTexture = new Texture2D (4, 4);
runtimeTexture.LoadImage (imageTextAsset.bytes);

string[] names = new string[] {
"Extracted region",
"Another region",
"Full sprite",
};
Rect[] regions = new Rect[] {
new Rect (79, 243, 215, 200),
new Rect (256, 0, 64, 64),
new Rect (0, 0, runtimeTexture.width, runtimeTexture.height)
};
Vector2[] anchors = new Vector2[] {
new Vector2 (regions [0].width / 2, regions [0].height / 2),
new Vector2 (0, regions [1].height),
new Vector2 (0, regions [1].height)

};



tk2dSpriteCollectionSize spriteCollectionSize = tk2dSpriteCollectionSize.Explicit (runtimeTexture.width/2, runtimeTexture.height/2);

tk2dSpriteCollectionData spriteCollectionInstance = tk2dSpriteCollectionData.CreateFromTexture (runtimeTexture, spriteCollectionSize, names, regions, anchors);

GameObject go = new GameObject ("sprite");
go.transform.localPosition = new Vector3 (-485.0842f, 480, 0);
spriteInstance = go.AddComponent<tk2dSprite> ();
spriteInstance.SetSprite (spriteCollectionInstance, 2);


Is there any easy way to load the Texture2D directly to tk2dsprite ?

Thanks

8
Support / Re: Too Many Spritesheets !
« on: November 06, 2013, 05:12:25 pm »
Thanks unikronsoftware
I will look into it  :)

9
Support / Re: Too Many Spritesheets !
« on: November 06, 2013, 04:22:05 pm »
Can you please explain about .png.bytes files, and then Resources.Loading them.
How can we do that ?

Krithik



10
Support / Re: Too Many Spritesheets !
« on: November 06, 2013, 01:56:25 pm »
So if we just have a image of 2048*1536 and we will use this image in Unity 3d's  2d Plane ,still unity will take 32 MB memory space in resources.assets ?

11
Support / Re: Too Many Spritesheets !
« on: November 06, 2013, 01:15:43 pm »
Thanks for the quick reply .
So when you have plans of releasing 2.3 which will have this feature .

I Guess one more option is to use 2d Planes to create background images , which will save lot of space in texture atlas ?

Thanks .

12
Support / Too Many Spritesheets !
« on: November 06, 2013, 11:07:08 am »
Hello,

We are facing some problems due to use of more textures . We have some 25 different textures (there are some 10 different stages in the game each has its own background) , and again each texture is created 3 times (iPad Retina , iPad , iPhone) . So that makes around 75 textures !!!
I saw that 2048 texture takes 16 MB & 4096 * 4096 takes 64 MB ! . So when compiling the project unity creates a file called resources.assets and its size becomes more than 1 GB !.
and compiling the project for iOS takes looong time more than 10 mins ! .

I am from cocos2d background , there we use lot of textures & everything works fine .
since we are working on 2d game on unity , there are lot of 2d images , so how we need to proceed  ? . Is there any workaround ?

&

One more question is whether we need to have original images which we used to create sprite sheets  in the resources folder of unity ? or can we delete it ?

I have also attached the Sprite Collection Settings & texture settings screenshot for the reference.

Thank you

13
Support / Re: 2d player follow like ski safari
« on: July 03, 2013, 12:28:47 pm »
Thanks unikronsoftware.

I was able to solve the change in players X position when zooming just by using small logic :) i.e. multiplying by zoom factor .

float zoomSize = _camera.orthographicSize/384; (384 is minimum orthographic size
newPosition = new Vector3 (player.transform.position.x + 384 * zoomSize, player.transform.position.y, this.transform.position.z);   //here 384 is minimum x distance in x axis.
this.transform.position = newPosition;

:)

Now looking forward to solve the player in between 1/4 to 3/4 of the screen :)







14
Support / Re: 2d player follow like ski safari
« on: July 02, 2013, 11:12:33 am »
Thank you for the reply .
I will look into all these calculations :)

Currently i am using orthographic camera do i need to use perspective camera because field of view is present in perspective camera ?

15
Support / Re: 2d player follow like ski safari
« on: July 02, 2013, 09:48:49 am »
Thank you for the reply .

I tried almost many things from past 3 weeks :)

Can you give some guidance for these problems

1)Since this game has parallax movement , i want the first 2 layers to zoom out when the player jumps and back layers to be constant (no zoom) . To get this effect whether we need to use 2 cameras ? or is there any alternative. I tried to keep scale of those backgrounds as always one by multiplying the camera zoom factor but it gives lot of flicker .
2)I want to move the player in between 1/4 to 3/4 in the screen, with proper zooming how can we make the camera to follow in y axis when the player goes below 1/4 of the screen & 3/4 of the screen ? since cameras position is dependent on player position i am finding difficulty to get boundary values.

If you can please check out this video  , its the gameplay of ski safari to check out camera follow.
http://www.youtube.com/watch?v=K2gGtDFKB0o

Thank you .

Pages: [1] 2