Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: scrlklk on July 20, 2013, 12:55:46 AM

Title: 2d toolkit clipped sprite
Post by: scrlklk on July 20, 2013, 12:55:46 AM
HI, i am new in playmaker and 2d toolkit. I am following the tutorial "whack the moles" on 2d toolkit website. http://unikronsoftware.com/2dtoolkit/doc/2.10/tutorial/whack_a_mole/scripting.html (http://unikronsoftware.com/2dtoolkit/doc/2.10/tutorial/whack_a_mole/scripting.html) And i decided using playmaker instead of the given C#script. but i got a problem on the clipped sprite part, i want the clipped sprite object - "mole" go down to the hole and i used the "itween move to" action. But it seem didnt work what i expected. Its just move down same as a normal object, not as a clipped sprite. Can anyone give me some help? :'(
Title: Re: 2d toolkit clipped sprite
Post by: scrlklk on July 20, 2013, 07:34:25 PM
Anyone got idea? :-\
Title: Re: 2d toolkit clipped sprite
Post by: jeanfabre on July 28, 2013, 04:14:20 PM
Hi,

 My gues is: it's because you need to move the cliprect property of the sprite. It's in the script:

http://unikronsoftware.com/2dtoolkit/doc/2.10/tutorial/whack_a_mole/code/MoleScript.cs

So if you try to set the ClipRect of your tk2dClippedSprite, you'll achieve the desired result. First you'll need to have a fsm rect variable, and you modify the y value of it, and you inject that rect variable in the ClipRect.

Bye,

 Jean