I think dynamic create animation and mounting it. Can do this?
by Chen Chao · in Torque Game Builder · 09/10/2007 (1:55 am) · 3 replies
%bug= new t2dAnimatedSprite()
{
sceneGraph = %this;
class = "Bug";
layer = 1;
size = "77 95";
animationName = "bug_Animation";
canSaveDynamicFields = "1";
MountOffset = "0.620 -0.021";
MountOwned = "1";
MountInheritAttributes = "0";
mountID = "6";
mountToID = "4";
};
%bug.playAnimation("bug_Animation");
I want it to mount the tree.Can do this?
{
sceneGraph = %this;
class = "Bug";
layer = 1;
size = "77 95";
animationName = "bug_Animation";
canSaveDynamicFields = "1";
MountOffset = "0.620 -0.021";
MountOwned = "1";
MountInheritAttributes = "0";
mountID = "6";
mountToID = "4";
};
%bug.playAnimation("bug_Animation");
I want it to mount the tree.Can do this?
About the author
#2
but i have the other qusition.
method:
mount(t2dSceneObject object,[float offsetX=0],[float offsetY=0],[float mountForce=0],[bool trackRotation?=true],[bool sendToMount?=true],[bool ownedByMount?=true],[bool inheritAttributes?=true])
need offsetX and offsetY
but method onMouseDown(%this, %modifier, %worldPosition, %mouseClicks) only provides worldPosition
How do I translate this position?
09/10/2007 (6:55 pm)
Thanks James :)but i have the other qusition.
method:
mount(t2dSceneObject object,[float offsetX=0],[float offsetY=0],[float mountForce=0],[bool trackRotation?=true],[bool sendToMount?=true],[bool ownedByMount?=true],[bool inheritAttributes?=true])
need offsetX and offsetY
but method onMouseDown(%this, %modifier, %worldPosition, %mouseClicks) only provides worldPosition
How do I translate this position?
#3
But, I think this might answer your question:
A world position turned into object space:
%sceneObject.getLocalPoint( worldx, worldy);
An object position turned into world space:
%sceneObject.getWorldPoint( localx, localy );
09/11/2007 (8:59 am)
Can you explain a bit more what you are trying to do? How is the mouse involved? But, I think this might answer your question:
A world position turned into object space:
%sceneObject.getLocalPoint( worldx, worldy);
An object position turned into world space:
%sceneObject.getWorldPoint( localx, localy );
Associate James Ford
Sickhead Games