Hello Guest

Author Topic: 2D Toolkit 1.75 beta 3  (Read 23511 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
2D Toolkit 1.75 beta 3
« on: June 11, 2012, 11:12:38 pm »
Bugfixes...

BUGFIX: Animation editor now has an "Add frame" button. Necessary when frames are grouped
ANIMATION: "Autofill" looks for 10 subsequent frames so it will fill even when frames are missing
SPRITE: Sprite positions are no longer "tweaked" for the calcinertia bug when running in Unity 3.5
SPRITECOLLECTIONEDITOR: Handle UI cases for disallowed combinations (eg. fonts in sprite collections with spanning enabled)
SPRITECOLLECTIONEDITOR: Dice and Custom geometry merged into a "Render Mesh" dropdown.

TMK

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Dragonhead Games
Re: 2D Toolkit 1.75 beta 3
« Reply #1 on: June 12, 2012, 12:36:08 am »
Thanks for all the updates! I am using TileMap for my next game, it's working great so far.

One suggestion for the TileMap, I have some tiles that uses prefabs (so I just use a placeholder icon in the TileMap), or other tiles that similar but work differently (e.g. a "power up" icon or something), but when choosing which one to paint in the Palette, since they look similar it's hard to see which one I am picking.

On the Paint tab, it would be great if you could show the name of the selected sprite above or below the "Palette" field somewhere, just the same name as its called in the SpriteCollection. Or alternatively, if Unity supports it, having an immediate ToolTip message when holding over a sprite showing the name or something.

Thanks!
« Last Edit: June 12, 2012, 05:14:53 am by TMK »

Marble

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #2 on: June 12, 2012, 07:06:00 am »
Is autofill with missing frames supposed to add only 4 frames to a clip at a time?  I can press it a bunch and it'll eventually get them all, but I thought it was more likely a bug.

I've attached a project.

1) Click on Animation/WalkAnimation
2) Click AutoFill
3) Click AutoFill again

Note that it only adds 4 frames of the whole walking animation (13 frames) every time you autofill.
« Last Edit: June 12, 2012, 07:18:42 am by Marble »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #3 on: June 12, 2012, 09:36:32 am »
That is indeed a bug - the count wasn't getting reset when the filler wasn't getting reset after it found something valid.
in the AutoFill function, replace the function to autofill section at line 713 to something like this -

Code: [Select]
int maxAllowedMissing = 10;
int allowedMissing = maxAllowedMissing;
List<int> pendingFrames = new List<int>();
for (int frameNo = baseNo + 1; ; ++frameNo)
{
int frameIdx = FindFrameIndex(clip.frames[lastFrameId].spriteCollection.spriteDefinitions, baseName, frameNo);
if (frameIdx == -1)
{
if (--allowedMissing <= 0)
break;
}
else
{
pendingFrames.Add(frameIdx);
allowedMissing = maxAllowedMissing; // reset
}
}


Previously, it was counting down maxAllowedMissing and never resetting that. My bad, sorry. I've fixed it in the current build and it'll be in the next beta/final.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #4 on: June 12, 2012, 09:47:50 am »
I'll put this in the next build. I've had more than one request for this, and its easy enough to implement.

Thanks for all the updates! I am using TileMap for my next game, it's working great so far.

One suggestion for the TileMap, I have some tiles that uses prefabs (so I just use a placeholder icon in the TileMap), or other tiles that similar but work differently (e.g. a "power up" icon or something), but when choosing which one to paint in the Palette, since they look similar it's hard to see which one I am picking.

On the Paint tab, it would be great if you could show the name of the selected sprite above or below the "Palette" field somewhere, just the same name as its called in the SpriteCollection. Or alternatively, if Unity supports it, having an immediate ToolTip message when holding over a sprite showing the name or something.

Thanks!

TMK

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Dragonhead Games
Re: 2D Toolkit 1.75 beta 3
« Reply #5 on: June 12, 2012, 01:27:36 pm »
I'll put this in the next build. I've had more than one request for this, and its easy enough to implement.

Awesome, thanks! :D

39thstreet

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 77
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #6 on: June 12, 2012, 05:10:23 pm »

Thanks for another quick update.

Unfortunately, the animation editor still has some big issues.  It's hard to articulate exactly what is happening, but it's impossible to create animations now.   

I have a 14 frame animation with a custom display order.

1. Whenever I try to change the "Num Frames" value, it seems to randomly add frames to existing frames (as before).
2. The note above says to use Add Frame (which is less ideal, because I have to click Add Frame 14 times).
3. I then start to fill in the values -- and while I'm setting frames, other frames that I'm not currently editing start randomly changing.

E.g. I'm setting frames 1,2,3,4,5,6,7 and by the time I set 7 and scroll back the start reads 1,3,5,6,1.   Weird, right?

Worse, it even seems to be showing this for older animations I haven't edited in a long time when I view them.  Suggesting maybe this is a display problem?

Going to roll back to an earlier beta for now.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #7 on: June 12, 2012, 07:22:28 pm »
You can simply turn off the grouping to restore previous behaviour - the code there isn't changed at all and should behave identically to the previous version. Could you get in touch by email - Ill try and get some more info from you to work out what's going wrong.

Bona

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #8 on: June 15, 2012, 08:42:14 am »
Thanks for the updates and many helpful fixes.

I have a problem with AnimationEventDelegate since Beta2, when I use the tk2dAnimatedSprite.Stop () function inside the delegate, it gives this error:

NullReferenceException: Object reference not set to an instance of an object
tk2dAnimatedSprite.SetFrameInternal (Int32 currFrame) (at Assets/Plugins/tk2d/Sprites/tk2dAnimatedSprite.cs:336)
tk2dAnimatedSprite.Update () (at Assets/Plugins/tk2d/Sprites/tk2dAnimatedSprite.cs:446)

To test this error, please insert "animSprite.Stop ();" to line 21 of tk2dDemoAnimController.cs and click on "Message" button in tk2d Demo 5.

In 1.75 beta 1 it works without problem, this only happened in Beta 2 & 3.
I'm working on a long animation (from MODO) which uses triggers (setup automatically with script) to stop after each action, if Stop() is not going to be available in AnimationEventDelegate anymore, I'll need to change my plan, please help. :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #9 on: June 15, 2012, 09:15:05 am »
Thanks for the bug report and repro case, that will make it really easy to track down.
edit: thats sorted now, it was because the order had changed in that the event was fired before the sprite changed - when you called Stop in the event, it cleared the currently playing clip. Let me know if you'd like a copy sooner (email support or PM) and I'll send you a copy before the next release.
« Last Edit: June 15, 2012, 09:46:09 am by unikron »

Bona

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #10 on: June 15, 2012, 11:34:48 am »
That's great! I'll PM my email to you asap.

I got another problem, for example I have a Trigger set at frame 100 to pause the animation with Delegate, when use PlayFromFrame( 90 ),  the animation is paused at frame 100 as expected but the other functions in the Delegate are not executed.

I asked because I need them to be executed for using this approach :

PlayFromFrame(xxx), Pause() in Delegate, SetFrame(yyy), Resume(), Pause() in Delegate...

instead of :

PlayFromFrame(xxx), Stop() in Delegate, PlayFromFrame(yyy), Stop() in Delegate...

I wonder which plays smoother?
If they're similar I would like to go with the later one because the codes are simpler and easier to jump between clips.

Please advise, thank you.
Sorry for the long post. ;D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #11 on: June 16, 2012, 12:14:33 am »
SetFrame simply sets a frame - it doesn't actually update the internal frame timer. If you can work this out and set it, then what you requested should just work. Check the update function on what goes on in there.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #12 on: June 17, 2012, 01:17:49 am »
Has anyone tried out the TMX import yet? Does it work OK for you?

wingjjzhang

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #13 on: June 17, 2012, 07:12:07 am »
Bugfixes...

BUGFIX: Animation editor now has an "Add frame" button. Necessary when frames are grouped
ANIMATION: "Autofill" looks for 10 subsequent frames so it will fill even when frames are missing
SPRITE: Sprite positions are no longer "tweaked" for the calcinertia bug when running in Unity 3.5
SPRITECOLLECTIONEDITOR: Handle UI cases for disallowed combinations (eg. fonts in sprite collections with spanning enabled)
SPRITECOLLECTIONEDITOR: Dice and Custom geometry merged into a "Render Mesh" dropdown.



Sorry first, I am not good at english.

My problem is , when I make a sprite(Named it "Box") by tk, and add a collider like boxcollider, same the way I make an other sprite(Named it "Floor"), what I wanna do is the Box will fall down on the Floor, so I add a rigibody to the Box, now run  it, and the Box fall down, right that seens good.

go on, I wanna scale the Box more bigger in code when I click the Box, so I write like flowe:

if (Input.GetMouseButtonDown(0)) {
            RaycastHit tHit;
            if (collider.Raycast(Camera.mainCamera.ScreenPointToRay(Input.mousePosition),out tHit,100f)) {
                _OriginalScale += factor; //add size above original scale
                _Box.scale = new Vector3(_OriginalScale , _OriginalScale , _OriginalScale ); // bigger more
            }
        }

I run it in unity, it runs well,we see the the Box grow bigger on the Floor,cool thing~
but when I build the project to ".exe", some times the Box grow and Penetrate in the Floor when I click, I don't know My wold
accurate, You can try it, the same things happen when I build to my android phont, every android phone.

than, I add a rigibody to the floor too,and set it static, but noting change,I don't know why it runs well in unity, but no when I build out.

Maybe it is the unity bugs,I had send a e-mail to unity too.

the end thx.....

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.75 beta 3
« Reply #14 on: June 17, 2012, 11:57:31 am »
@wingjjzhang - I have replied to your other post in the private support forum, but haven't had a response from you. I need more information to answer your question as I have explained in that post.