playMaker

Author Topic: 2d toolkit clipped sprite  (Read 3527 times)

scrlklk

  • Playmaker Newbie
  • *
  • Posts: 3
2d toolkit clipped sprite
« 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 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? :'(

scrlklk

  • Playmaker Newbie
  • *
  • Posts: 3
Re: 2d toolkit clipped sprite
« Reply #1 on: July 20, 2013, 07:34:25 PM »
Anyone got idea? :-\

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2d toolkit clipped sprite
« Reply #2 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