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.

Topics - pdform

Pages: [1]
Support / Align tk2d Sprite with Unity UI
« on: August 17, 2015, 04:15:18 pm »

I've decided to port my HUD to Unity UI mainly for the great layout and text handling facilities, however, I need to align my HUD to the game map and place some sprites exactly over UI icons. How can I obtain a valid tk2d sprite position given Unity UI rect transforms, for instance, their center and edges, so I can smoothly align and position sprites along UI elements? I've tried fooling around with camera's NativeResolution, TargetResolution, ZoomFactor and rect.sizeDelta, but none of the transformations I tried worked.

Thanks in advance!

Support / Anchors and Flip
« on: February 05, 2013, 11:41:54 pm »

I've noticed that if you flip a sprite on the editor, the sprite's anchor keeps working as expected, however, if you flip it on runtime, some crazy behavior occurs. For instance, I've set a center anchor, and called FlipX on a sprite. Since the anchor is in the center, I'd expect the sprite to be flipped around the center, so the anchor would still be at the center, however, I observe it changes to pos.x - sprite width / 2. Is it normal?


Support / Move tk2dCamera
« on: February 05, 2013, 11:24:24 pm »

I've searched the forum and didn't find anyone with this exact issue... I want to use tk2dCamera, because of the facilities it provides, however, since the objects' (absolute) positions are turned into their position on the screen, it is necessary to move the objects, i.e., apply a negative offset to the whole scene, in order to simulate a positive offset in the camera. In most cases, it seems much more intuitive to me moving the camera instead of the objects, when I want the camera to follow a certain object or to achieve a certain movement pattern. Am I missing something here, or is it actually the expected behavior? Is there any simple way to make the objects' relative position to the camera their actual position on screen?

Thanks in advance!

Support / Change FPS on runtime?
« on: August 25, 2012, 10:11:48 pm »

I'd like to change the FPS for some clips at runtime. I've first done something this:

Code: [Select]
animSprite.anim.clips [animSprite.anim.GetClipIdByName ("anim")].fps = newFPS;
However, I've had the terrible experience to discover it changes the FPS in my sprite collection permanently as well, not only in runtime. I'd like to keep the initial FPS for my animation as a reference, and change it proportionally to my objects speed. So, a simple FPS scale attribute would be enough for me, but if I could just change the FPS in runtime without changing it permanently in the project it would be fine too.

So, am I doing something wrong or is it the actual expected behavior?


Pages: [1]