标签: python canvas tkinter overlap
假设我在Canvas中有标记为'stopped'和'flying'的对象。
'stopped'
'flying'
如何检查这些物体是否相互重叠?
答案 0 :(得分:2)
您可以使用方法find_overlapping
find_overlapping
find_overlapping(x1, y1, x2, y2) => tuple Returns a tuple of all items that overlap the given rectangle, or that are 完全被它封闭。
find_overlapping(x1, y1, x2, y2) => tuple
find_overlapping(x1, y1, x2, y2)
tuple
Returns a tuple of all items that overlap the given rectangle, or that are
然后遍历结果列表,查找您的标记。