I have an object where if the player hovers their cursor over some text on the object, a border appears around the text. This is the code I have for the same:
Multiple instances of the object could be present in the room, all of which can be clicked and dragged. If one of the instances is dragged over the other, and the player hovers over the text, then the borders of all instances under that point get shown like in the below image where I hover over "Option 2b":
Ideally, I only want the border over the topmost instance if multiple are present at the same point. What can I do about this forum? Thanks in advance!
GML:
if (point_in_rectangle(mouse_x, mouse_y, x + 18, y + 50, x + 278, y + 60 + string_height_ext(options[0][0], sepVal, wrapLength) + 10)) {
draw_rectangle(x + 18, y + 50, x + 278, y + 60 + string_height_ext(options[0][0], sepVal, wrapLength) + 10, true);
}
Ideally, I only want the border over the topmost instance if multiple are present at the same point. What can I do about this forum? Thanks in advance!