# Why are the dots bouncing? CodeHelp

#22

Almost got it. All I need to do is the rotation symbol and 2 of the corner ones. (Which I don’t know why aren’t working.) Do you think that you could try and explain what all that complicated maths is doing? I was just putting it in without any clue as to what I was making and I’m interested to learn new skills. @ThinBuffalo

#23

Hmmm… I edited the custom rule, which was in all the corners, and I set the (self)angle variable to the right thing but the upper left and the bottom right corners don’t seem to like it.

#24

My fault. Need to fix the formula… hang on

Edit: Ok, change the (self)Angle for the corner dots. Counterclockwise from the upper-left; 0, 0, 180, 180

The 2 problematic corners also need a different formula so make a copy of the Corner Position ability (to be used only on those 2 dots) and change the bit of

… + arctan(xxxxxxxx) + …

to

… + (180 - arctan(xxxxxxx)) + …

1 Like
#25

Do you think that you could try and explain what all that complicated maths is doing? I was just putting it in without any clue as to what I was making and I’m interested to learn new skills.

How can I say no?

Hopefully this will help…

For the anglular part of the positioning formula:

And for the radius part of the positioning formula:

3 Likes
#26

Ummm… Wow. Thanks.

2 Likes
#27

@MISSION_IMPOSSIBLE I found out why but I can’t fix it; when dots rotate they do it on a 360º degrees rate, that means they do a circle, so they don’t fit on the rectangle, that’s why

1 Like
#28

I hope this helps! But I’m sorry I couldn’t fix it @codehelp someone could help him?

3 Likes
#29

@MISSION_IMPOSSIBLE
just making sure you didn’t miss this post with the fix to the 2 stray corners

1 Like
#30

I have seen it! I fixed it and I have actually published the project. If you are interested:

Thanks again for all the help.

4 Likes
#31

You’re welcome.

If you follow all the math and want to take the project to the next level, try making it so you drag the dots to increase or decrease the size rather than needing the “get bigger”/“get smaller” button

1 Like
#32

Yeah. I know. That has been on my mind, but it is just another layer of complexity. It would be cool though.

1 Like
#33

I made something similar, except as a Window (may use for PC project)
It’s called “Resizable Window”

#34

Yeah, I saw that project. It’s pretty cool. Do you have any advice on how to make the square grow or shrink depending on which way you drag it instead of my current system?

#35

@ThinBuffalo, I am making it so you can just drag the square instead of using the button. All the sides work, but the corner dots change positions when the square is flipped. Since my system is changing the square’s X and Width by the distance between your finger and the dot’s position, the corner dots changing position messes the whole system up. Do you have a fix for the position or an alternate way to do the resizing?

1 Like
#36

That’s hard to say without seeing the details of the code and seeing how it “messes up”

I think the size should change according to this logic:

• When dot is dragged away from center of image (based on the dot’s position when tapped), the absolute value of the size should increase
• When dot is dragged toward the center of image (based on the dot’s position when tapped), the absolute value of the size should decrease

That means after the orange dot switches to the left & the image width is negative, subsequently dragging it further to the left (away from the center) should further decrease the image size (appearing to make it larger).

1 Like
#37

Here’s a link. (Only the orange dot works)

I’ll try and make the resizing like you said.

1 Like
#38

Can’t quite get it to work. Could you please elaborate a bit more?

#39

#40

This topic is showing people a problem and what could be done to solve it… I don’t think this qualifies for ‘cliving’. I don’t personally mind much, but I don’t think it meets the qualifications.

#41

hmm…

• over three months old
• a solved question, it seems

seems like it could be clived but not clivecated. @MISSION_IMPOSSIBLE do you consider your question in this topic solved?

2 Likes