ID:2220034
 
Resolved
Maptext bounds for mouse hit detection were incorrect in some cases.
BYOND Version:511.1376
Operating System:Windows 7 Home Basic
Web Browser:Chrome 56.0.2924.87
Applies to:Dream Seeker
Status: Resolved (511.1376)

This issue has been resolved.
Descriptive Problem Summary:

For some reason the bounding box of a screen object with maptext, is completely off point.

Here's an example of what's happening: https://gyazo.com/08143c81f3f7490d5df04cab121f1fd7

The objective here is for the text to be activated when the cursor is over the text. Now, although you cannot see where the mouse cursor is in the .gif, take my word that it is located at the very top left of the screen, instead of directly over the maptext.

Code Snippet (if applicable) to Reproduce Problem:
obj

questions
question1
maptext_width = 320
maptext_height = 150
//screen_loc = "11,2"
mouse_opacity = 2
plane = 2
layer = TOPDOWN_LAYER
alpha = 150
maptext = "<b><font align= center size = 3 color = white >Why did you choose that route?</font></b>"
New(mob/U, var/screenLoc = "1,1:5")
..()
screen_loc = screenLoc
U.client.screen += src


MouseEntered()
alpha = 255
..()
// world<<"w"
color = rgb(255, 188, 63)
var/matrix/M = matrix()
M.Scale(1.2)
src.transform = M

MouseExited()
alpha = 150
color = rgb(255, 255, 255)
animate(src, transform = null, time = 3, loop = 1)
..()




Lummox JR resolved issue with message:
Maptext bounds for mouse hit detection were incorrect in some cases.
Bump. This problem is still not fixed in .1376.
I tested this fix against your test case. Do you have a new test case that shows something different?
Even on the same test case I previously sent you, it doesn't work. The mouse is no where near the maptext when it is activated. It seems like the area of hit detection is bigger but the the bounds aren't right.

Edit: I take it back, I didn't adjust the maptext bounds. Sorry! This is indeed working.
Oh good. I did see that the maptext upscaling was done incorrectly without applying linear sampling, so that should be fixed in the next build.
I've noticed that the bounds always start from the left and extend to the end of the maptext_width bounds. So if a maptext has a center alignment, it will recognize all the empty space to the left of the actual text, instead of just the specific area the text is. Is there some way around this?
In response to Exentriks Gaming
Nope. Mouse hits with maptext are always based solely on the maptext bounds, not the maptext itself.

In the future I would like to support some more nuanced interaction, like with links.