[Behavior] moveto

Post your completed addons to share with the community

Post » Wed Aug 31, 2016 7:41 am

@Smileh

Platformer moveTo is here, which is a helper behavior of official platform behavior. It is not equal to moveTo behavior.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Wed Aug 31, 2016 7:53 am

rexrainbow wrote:@Smileh

Platformer moveTo is here, which is a helper behavior of official platform behavior. It is not equal to moveTo behavior.


Oh thanks. I guess I missed that.

But what about the LiteTween? New version doesn't overwrite the old one.
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Wed Aug 31, 2016 7:55 am

@Smileh

I don't know, lite tween is not my behavior.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Thu Sep 01, 2016 8:25 pm

I don't know if i found a bug or i'm using it in a way is not correct(I guess the last XD)

Using Drag&Drop2 and PintTo Imagepoint plugins.

I have an event called:

Sprite set width to:
distance(Scaler_right.DragDrop2.X,Scaler_right.DragDrop2.Y,Scaler_left.X,Scaler_left.Y)

And event that when the sprite is selected(one time event) > Scaler_right Pinto image point 5 .

So the idea is set the size of the sprite with the distance between the Scaler_left and the scaler_right. If i move the Scaler_right the sprite is updated no problem.

But if when is dragging the scaler_right, i move the cursor on Y the distance that is set to the sprite is always the distance of Scaler_left and the mouse.x/y.

Seems not matter if i pin or set position of the scaler to X point, the distance when is dragging the scaler will be with the mouse.

I put the events before and after but nothing changes. Seems the pointer event runs more times or have always priority front the PIN or Set position and not set the distance correctly.

I guess someway to solve the problem is to the distance expresion substract the difference of the Y or something like that but i'm very bad with maths XD.

Here is the actual program:
https://dl.dropboxusercontent.com/u/659 ... index.html

Press the button circle to create one and drag the scaler in the middle-right(the one with a green square) to the right(is locked to move only to the right) and will do the resize correctly.

But if you stop and go up on Y, the sprite also will be resized. And after some test i found that is because get the distance with the mouse and not with the scaler_right with the pint or with the set position.
B
17
S
7
Posts: 329
Reputation: 2,058

Post » Fri Sep 02, 2016 7:27 am

@matriax

Please provide a very simple capx to demonstrate your requirement.
For now, it seems that you want to resize sprite when dragging.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Fri Sep 02, 2016 8:08 am

@rexrainbow Here the very simple .capx ;)
https://dl.dropboxusercontent.com/u/659 ... oblem.capx
B
17
S
7
Posts: 329
Reputation: 2,058

Post » Fri Sep 02, 2016 8:45 am

@matriax

The steps of executing are-
1. (before event tick) Position of scaler_right changed by dragging. Since this scaler_right could be moved in both axis, it should be put on current dragging point.
2. (during event tick, i.e. condition: every tick) Get the distance between scaler_right (which is located at current dragging point) and scaler_left, and set the width of sprite according the disctance
3. (after event tick) Pin the position of scaler_right to the image point, like official pin behavior. Therefor the position of scaler_right will be changed. It will not locate at current dragging point.
4. render.

The problem is - position of scaler_right in step2 is not equal to the final position in step4, remove the pin to image behavior to see the real position in step2.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Fri Sep 02, 2016 10:46 am

@rexrainbow I see, when i pinned the object i expected that the drag not affect to them or the execution was first or something.

If i put only horizontal axis in drag&drop2 and keep the sprite at angle 0, works correct, no matter how much the mouse goes to y. But if i rotate the sprite get problems because the angle/axis of sprite/scaler are not the same.

So, in the same way you added a restriction of Drag&Drop to horizontal/vertical, is there some way that you can add some event of "restriction by angle" or axis? So with that i can rotate the sprite and drag&drop in the Sprite.Angle without problems doing all correctly.

Here is the same capx adding a keys to rotate the sprite left/right to see what happens when you try to resize in some angle using Both Axis or H/V:
https://dl.dropboxusercontent.com/u/659 ... blem2.capx

So we can say: every tick -> Drag&Drop2 Lock angle at (Sprites.angle)

And we will can drag and drop objects at the angle desired. Is possible?
B
17
S
7
Posts: 329
Reputation: 2,058

Post » Fri Sep 02, 2016 4:02 pm

Update


rex_dragdrop2 behavior:
- add property "Axis angle" to rotate the axis, or set it by "Action:set angle".
This feature only works when the property "Axis" is "Horizontal" or "Vertical". (sample capx)



@matriax
Try this updated.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Fri Sep 02, 2016 6:43 pm

@rexrainbow It's me or the axis are inversed or something? I set the Angle of the sprite to the drag but is not the same. If you drag the scalr righ the drag slide in other angle ¿? .

https://dl.dropboxusercontent.com/u/659 ... blem3.capx

When the sprite angle is 20, the drag is 340. And when the Sprite angle is 20, the drag angle is 340 :P

Or again i'm doing something wrong...

EDIT: Well i fixed doing : Set angle > 360-Sprite.setangle to get the inverse and now the resize works perfect.

So this is the way this have to work, or in the behaviour you added the angle in degrees inverse as construct2? I ask to put this in my program or wait to you for invert the angle degrees equal than construct2.
B
17
S
7
Posts: 329
Reputation: 2,058

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests