27 Replies
(I can safely say you're not speaking Québec-French)
But for your question: You have the position and size of the items?
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
Are they all considered circles, square, or something else?
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
Then you check if any corner of an item is within the boundaries of another.
Not the same. Contained within.
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
It's not quite that many though.
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
See how the inner for starts at
i + 1
, not 0.Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
Say it in French and I'll tell you the word you're looking for 😉
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
"I'll keep you posted."
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
I wouldn't do that. If you do, you can't start the inner loop at the current index of the outer one.
And it's not only "is not".
Go for a simpler example. Let's say you have 3 coins (a, b, c). How would you check if any coins touch.
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
You check if A touches B, if A touches C, if B touches C. You never check if B touches A or C touches A since you already did the other way around.
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
And to see if they overlap, since they're all the same size, you check if a corner is inscribed within a rectangle.
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
Meaning:
corner.X >= shape2.Left && corner.X <= shape2.Right &&
corner.Y >= shape2.Top && corner.Y <= shape2.Bottom
Sure
(if you don't understand something I say, I can translate. I just have to keep it generally in English to allow for anyone to step in and help.)
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
Not quite. I think you should break it down first. Extract the values you'll need, it will make it easier to debug:
And then do your checks.
So for example,
corner1X
will probably be Canvas.GetLeft(Canvas_Board.Children[i])
while corner2X
will probably be Canvas.GetLeft(Canvas_Board.Children[i]) + ElementSize
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
I went with 1 = top left, then clockwise.
Or you can do
1 2
3 4
It's not important, as long as you know!
Unknown UserOP•3y ago
Message Not Public
Sign In & Join Server To View
✅ This post has been marked as answered!