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

Pages: [1]
1
Support / Animations - references, atlases, and performance
« on: January 04, 2016, 06:10:05 pm »
Hi!

I am still undecided should I go with standard Unity animation system. What I like about 2D Toolkit is mobile performance and the ability to quickly test the animations. But since I am porting game from Haxe to Unity, I am trying to find ways to reduce the time of the development. I spent already lot of time on this, but I cannot find clear answers and clear solutions. Hopefully this thread will help me, thank you.

1) What is the performance gain when using 2D Toolkit Sprite Collections compared to standard Unity 5 asset system? What is the performance difference overall for the 2D development for PC, mobile, and consoles? Is there any benchmark comparision available somewhere? Since I make intense 2D top-down shooter games, I have hundreds of rotating/animating enemies and bullets on the screen.

2) From what I understood so far, it is not possible to create Spritesheets from complex atlases generated by the Texture Packer. Though I noticed that the Texture Packer has the 2D Toolkit export. Right now the best practice I found is to use single sprites, which is okay since I can slice them again in Photoshop.

3) Is it possible to set the Collection and the Clip during runtime? If not, is there any way to connect the animations with variables or I need to create prefabs for every animation?

Thanks!

2
Support / Re: Pivot/anchor variable doesn't exists
« on: January 04, 2016, 01:25:10 pm »
Thank you, this works!  8)  So basically this is the same as the pivot for Sprite, right. At least, values are the same.
When setting y value I am subtracting from screenHeight because I am using top left coordinate system. (maybe it will be useful to someone)
If you use normal coordinate system, just remove "screenHeight -" part.

   public float x {
      get{
         Vector3 topLeft = new Vector3(baseSprite.GetUntrimmedBounds().min.x, baseSprite.GetUntrimmedBounds().max.y,0);
         return (new Vector3(transform.position.x, transform.position.y, transform.position.z) + topLeft).x;
      }
      set {
         Vector3 topLeft = new Vector3(baseSprite.GetUntrimmedBounds().min.x, baseSprite.GetUntrimmedBounds().max.y,0);
         transform.position = new Vector3(value, y, transform.position.z) - topLeft;
        }
   }

   public float y {
      get {
         Vector3 topLeft = new Vector3(baseSprite.GetUntrimmedBounds().min.x, baseSprite.GetUntrimmedBounds().max.y,0);
         return screenHeight - (new Vector3(transform.position.x, transform.position.y, transform.position.z) + topLeft).y;
      }
      set {
         Vector3 topLeft = new Vector3(baseSprite.GetUntrimmedBounds().min.x, baseSprite.GetUntrimmedBounds().max.y,0);
         transform.position = new Vector3(x, screenHeight - value, transform.position.z) - topLeft;
         //transform.position = new Vector3 (transform.position.x, screenHeight-(value-offsetY+origin.y), transform.position.z);
      }
   }

3
Support / Re: Pivot/anchor variable doesn't exists
« on: January 02, 2016, 05:11:49 pm »
I actually have this code already working with Unity Sprites and Sprite Renderer, but I also want to able to use this when using 2DToolkit sprites.

This is the code:
width = GetComponent<SpriteRenderer> ().bounds.size.x;
height = GetComponent<SpriteRenderer> ().bounds.size.y;
origin.x = width - renderer.sprite.pivot.x;
origin.y = height - renderer.sprite.pivot.y;

public float x {
   get{ return (transform.position.x-origin.x); }
   set { transform.position = new Vector3 (value+origin.x, transform.position.y, transform.position.z); }
}
public float y {
   get { return (transform.position.y)-origin.y; }
   set { transform.position = new Vector3 (transform.position.x, value+origin.y, transform.position.z); }
}

4
Support / Pivot/anchor variable doesn't exists
« on: January 01, 2016, 11:13:23 pm »
Hi!

I have one problem.
I use pivot to change the center of rotation/scale, but Unity works in way that it affects also the position of object - which is a problem.

I want that x,y coordinates of object are always in the top left. To make this work I need to use the value of pivot and offset the position.

But it seems 2DToolkit doesn't have this variable.
Since this is critical and I need to finish this project asap, could you please explain me how I can tweak 2DToolkit to make this possible?
Thank you!

EDIT: in return of the favor I will also share the code here for the case if someone else will need it. Thanks again. :)

5
Support / Questions about 2D Toolkit
« on: September 22, 2013, 09:03:44 am »
Hey !

I am coming from Flixel scene, I made a lot of 2D games using it, but as projects got more complicated I decided it is time I switch to Unity. In game we are making we have combination of 2D and 3D elements.

I started going through video tutorials, they are made really well, and Unity is easier to use then I thought, but I would like to speed up the process, and code faster.
Basically I am looking for a framework that extends Unity, and makes some things more simplified, kinda like Flixel.

For example instead of writing transform.Translate( new Vector3 etc . ) I would like to just write x = 100, y = 50 , z = 30 etc. Same goes for angles and everything else. I also need that this framework supports velocities, mouse position, and stuff like that.

I am wondering is 2D Toolkit adding this functionalities ? 

Also, does 2D Toolkit supports perspective camera because we want that some objects are 3D ( mostly enviroment ), and we also want that 2D objects throw shadows.


Thanks !

6
Support / 2DToolkit options don't show up in GameObject ?
« on: September 15, 2013, 09:35:48 pm »
Hey ! :)

I imported the 2DToolKit package following instructions from WhackAMole tutorial, but the problem is that there is no "tk2d" in GameObject list after importing.

What should I do ?

Thx !

Pages: [1]