T2DAnimationComponent
by Jelili · in Torque X 2D · 01/20/2009 (8:55 pm) · 4 replies
Has anyone gotten the T2DAnimationComponent to work ??? I've been trying to get it to work with link points but I'm having trouble. I haven't seen any tutorials on how to use this component in TXGBuilder and its kind of getting frustrating. I don't want to reprogram something that is already there.
#2
If you have any other link or references I would be very grateful.
01/21/2009 (8:41 am)
Thanks ... but I'm referring to the T2DAnimationComponent. I want to try the parameter linking and I don't know how to link it to a link point by using the ParameterName Value in Builder. I also have John K's book and that is the One Component he does not explain in the Book. If you have any other link or references I would be very grateful.
#3
Brian
01/21/2009 (10:02 am)
The Rainy Day tutorial uses a link point in the builder. It mounts a collision zone but it is pretty much the same thing you would do for any other object type. Not sure if you're referring to some other type of link point. Let me know if that helps.Brian
#4
1. Add T2DAnimationComponent To a Static Sprite In TXGB
Note: I'm Using test for this example as the parameter i want to use
2. Add some Animation Data to the Animation List
Fill
ParameterName with [test]
Duration 5
MinValue 0
MaxValue 100
Check PingPong
3. Click the Green Button next to Animation
This adds the animation to the list of animations to use
You should now see an animation that has these parameters
test 5.000 0.0 100.000 1 0 0
ok Now You need to have a Component that has the value test
4. Create a new Component call it whatever you want in the code add these lines
Under #region Private, protected, internal fields
ValueInPlaceInterface<float> _test = new ValueInPlaceInterface<float>(0.0f);
In _RegisterInterfaces :
Owner.RegisterCachedInterface("float", "test", this, _test);
At the end of _OnRegister :
ProcessList.Instance.AddTickCallback(Owner, this);
In ProcessTick :
_sceneObject.Position = new Vector2(_test.Value, _sceneObject.Position.Y);
5. Compile
6. In TXGB Add the new Component to the object you added the T2DAnimationComponent to.
Now You should have a sprite that ping pongs from value 0 to 100 within 5 seconds.
Hopefully this is a beginning for people who want to look into using that Component.
01/21/2009 (1:03 pm)
I figured out what I needed to do Here is an example for anyone else who might need this info.1. Add T2DAnimationComponent To a Static Sprite In TXGB
Note: I'm Using test for this example as the parameter i want to use
2. Add some Animation Data to the Animation List
Fill
ParameterName with [test]
Duration 5
MinValue 0
MaxValue 100
Check PingPong
3. Click the Green Button next to Animation
This adds the animation to the list of animations to use
You should now see an animation that has these parameters
test 5.000 0.0 100.000 1 0 0
ok Now You need to have a Component that has the value test
4. Create a new Component call it whatever you want in the code add these lines
Under #region Private, protected, internal fields
ValueInPlaceInterface<float> _test = new ValueInPlaceInterface<float>(0.0f);
In _RegisterInterfaces :
Owner.RegisterCachedInterface("float", "test", this, _test);
At the end of _OnRegister :
ProcessList.Instance.AddTickCallback(Owner, this);
In ProcessTick :
_sceneObject.Position = new Vector2(_test.Value, _sceneObject.Position.Y);
5. Compile
6. In TXGB Add the new Component to the object you added the T2DAnimationComponent to.
Now You should have a sprite that ping pongs from value 0 to 100 within 5 seconds.
Hopefully this is a beginning for people who want to look into using that Component.
Torque Owner Brian
I use it quite a bit. The most helpful tutorial as far as basic animation actually came from the hello world tutorial (first tutorial). You can also get John K's book which covers practically everything you need to know as well.
Hope that helps,
Brian
P.S. You can find all the docs/tutorials by going up to Support then clicking documentation at the top of the page here. Then click the TX graphic. Finally click the link at the top where it says official documentation. :)