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

Pages: [1]
1
Support / Re: Prefab with camera anchor loses the public camera variable
« on: September 12, 2016, 08:34:25 am »
Hi,

yes it's in the scene. Hmm I see.

I just add inside the Start() method now:
Code: [Select]
    _tk2dCamera = GameObject.Find( "tk2dCamera" ).GetComponent<Camera>();
    _textAnchor.transform.parent = _tk2dCamera.transform;
    _textAnchor.AnchorCamera = _tk2dCamera;

Thanks!

2
Support / Prefab with camera anchor loses the public camera variable
« on: September 06, 2016, 09:24:25 am »
Dear all,

I have a strange problem with a prefab. It's a tk2d text prefab which has a tk2dcameraanchor attached to it. This anchor has a public variable called "Camera". Everytime I restart Unity (5.4) this prefab loses the camera variable. Is there a solution to that?

Please take a look at the attached screenshots. Thanks!

3
Support / Clipped Sprite setting new width doesn't work for me
« on: August 23, 2016, 07:17:42 pm »
Hey there,

using Unity 5.4 I try to do some kind of a progress bar and use a clipped sprite for it. Setting it in the editor works perfectly, but not via code:

Start method:
Code: [Select]
_sprite = GetComponent<tk2dClippedSprite>();

Update method:
Code: [Select]
_sprite.SetSprite( "repairing-bar" );
_sprite.clipTopRight.Set( 0.5f, 1.0f );
Debug.Log( _sprite._clipTopRight.x );

_sprite.ClipRect.Set( 0.0f, 0.0f, 0.5f, 1.0f ); doesn't work either...

The editor and debug log both show still 1.0 for the x value (width here) which should be 0.5. I tried ForceBuild() as well but no change. Obviously I'm doing something wrong here?

Thanks!

edit: Well ya got it. My fault. Doing:
Code: [Select]
_sprite.clipTopRight = new Vector2( 0.5f, 1.0f );

is obviously the right thing to do here!

Pages: [1]