ID:901337
 
(See the best response by Nadrew.)
Code:
StsBox.maptext = "<font style='font-family:Tahoma; font-size:8px;'>Test</font>"




Problem description:

Hey guys~ Experimenting a bit with maptext in some screen objects.

I'm trying to add this text to it, (Which, I wish I could just use a stylesheet, but adding a stylesheet in the map control didn't seem to affect maptext any..)

I cannot figure out how to position the text properly :S

That HUD it's in is a 64x32 icon, I'd like for the text to be in the green area, it doesn't seem possible at the moment though. Anyone have any ideas?

Best response
The best way to control fine positioning of maptext is attach the maptext to an image object and add that image to the HUD object's overlays. Now if you modify the pixel_x and pixel_y of the image object you can have pixel-precise positioning of the maptext.
In response to Nadrew
Now, if only we could do this:
maptext_x = 4
maptext_y = 4
maptext = "blah"

Instead of this:
var image/img = new
img.pixel_x = 4
img.pixel_y = 4
img.maptext = "blah"
overlays += img

// Maybe you want to change its position in the future?
overlays -= img
img.pixel_x = blah_x
img.pixel_y = blah_y
overlays += img
Thank you Nadrew.

Kaiochao, I was thinking the same thing, it'd be a great addition, and very helpful for making easier use of maptext.

I'll use the image object way, time to crack open the reference and learn a bit more.
Just going to say that for most of my positioning I use <text align=top> and then modify the maptext_height. That won't work for everything though, so the previous solution would be better.