Thank you for your reply. I started a new topic since I wasn't getting any follow up...
Can you explain what each line does? I don't want to end up with the object moving around the screen, I want to be able to place it. I will have a variable, YPosition, coming in over CAN, and when it changes I want to move the object to the new position. How do I reference the incoming data variable? Are all those lines required to change the Y position of an object?
void $ScreenMoveAction$ ()
{
ScreenPositionData scr;
scr.ObjectID = ScreenObjectIDs.Ellipse_Widget;
scr.Recurrance = 20;
scr.AnimationType = AnimationTypes.FastInAccelerator;
scr.AnimationFactor = 3;
scr.EventId = EventIDs.ScreenRotateAction;
scr.XValue = 450.0f;
scr.YValue = 123.0f;
SendActionObject( ApplicationIDs.Screen , ActionIDs.Screen_AnimatePosition , @scr);
SendAction( ApplicationIDs.Screen , ActionIDs.Screen_Process, ActionData.Empty );
I think it might be easier using the state machine since I am only changing the y position.
Can you explain how to use Screen Application/Move in state machines?
It says "Move an object to location using MovePosX/MovePosY variables. Requires process."
Thanks,
Phil
Moving an object on a screen
- drphil69
- Posts: 139
- Joined: Wed Mar 02, 2011 5:59 pm
- boyce
- Enovation Controls Development
- Posts: 322
- Joined: Wed Sep 08, 2010 5:09 pm
Re: Moving an object on a screen
I was waiting on an example of animation using a state machine but the one I got seemed too complicated. So I'll just give you the actions to move an object.
In a state it really only needs 2 actions:
Screen->AnimatePosition(SCR_OBJ, 155, 135, 25 steps)
Screen->Process((Empty))
In the Screen->AnimatePosition select the Screen Object (SCR_OBJ for example) and the X and Y Expressions (just the X and Y coordinates in this example).
Screen->Process is the Requires process statement that you mentioned.
Hope this helps.
In a state it really only needs 2 actions:
Screen->AnimatePosition(SCR_OBJ, 155, 135, 25 steps)
Screen->Process((Empty))
In the Screen->AnimatePosition select the Screen Object (SCR_OBJ for example) and the X and Y Expressions (just the X and Y coordinates in this example).
Screen->Process is the Requires process statement that you mentioned.
Hope this helps.
Boyce Schrack
Enovation Controls
Enovation Controls
- drphil69
- Posts: 139
- Joined: Wed Mar 02, 2011 5:59 pm
Re: Moving an object on a screen
Ok, I see what I was doing wrong. I thought I could use the "Move" command, but that apparently doesn't do what I want.
I used the animate in state machines and it all works perfectly!
Thank you!
Phil
I used the animate in state machines and it all works perfectly!
Thank you!
Phil