ID:1706572
 
(See the best response by Kaiochao.)
Code:
Nothing here but a bunch of ferrets!


Problem description:

I wonder, is there a way to get the relative screen position of an atom on a map? Say, I want to get the position of a mob whose position on the world is...oh, let's say 2,4 and the map is 5x5 (and the view size is conveniently 3x3). You are on the center, 3,3 (with step_x/step_y at 0), so in your view that mob would be at 1,3. The problem is actually getting that, as I don't see a way to do it (at least right away).

A good use for this is to have damage numbers appear where needed client-side.
You could the get the distance from the mob to the user. subtract src.x-othermob.x, src.y-othermob.y.

The mob is usually in the center of the screen, so you always know exactly where the user's mob is in the client screen, unless you have EDGE_PERSPECTIVE on.

subtract the calculated and y to the position of the user in the client screen.

or just do what kaiochao says.
Best response
Wontoon wrote:
A good use for this is to have damage numbers appear where needed client-side.
Just use /image objects for that. They'll even follow the target, which a screen object would have to be updated for.
In response to Super Saiyan X
Super Saiyan X wrote:
You could the get the distance from the mob to the user. subtract src.x-othermob.x, src.y-othermob.y.

The mob is usually in the center of the screen, so you always know exactly where the user's mob is in the client screen, unless you have EDGE_PERSPECTIVE on.

subtract the calculated and y to the position of the user in the client screen.

or just do what kaiochao says.

I actually was thinking of that method using the distance formula, but thought it wouldn't work when my character's camera (or, client.eye I guess) didn't move. I'll also poke around with /images too. Thanks for the replies!