In response to Lugia319
Lugia319 wrote:
> obj
> Letter
> pixel_x = 10
> pixel_y = 10
>

If you created a new letter, it would appear 10 pixels to the right and 10 pixels from the bottom.

This is wrong when talking about screen objects.
Screen objects don't use the pixel_x and pixel_y vars for pixel offsets, but instead use a unique syntax on their screen_loc var.

Third-to-last paragraph:

It is also possible to specify a pixel offset. Screen objects do not use pixel_x and pixel_y for this purpose, because it is intended that an object could exist on the map and in the screen object list simultaneously, so positioning must be independent. Pixel offsets are specified after a colon like this: "1:16,1:16". In this case the object is shifted to the northeast by 16 pixels.
mob
var/MHP = 100
var/HP = 100
Login()
..()
UpdateHealth()
proc
UpdateHealth()
var/objx = 20
var/objy = 20
for(var/L in "Health: [HP]")
var/obj/font_letter/f = new
world << f
f.icon_state = "[L]"
f.screen_loc = "[objx],[objy]"
world << f.icon_state
world << f
client.screen+=f
objx++



obj
font_letter
icon = 'Arial7pt.dmi'

-- Old Code

New code uses images instead of shitty client.screen.

mob
var/MHP = 100
var/HP = 100
var/list/stuff_to_delete = list()
Login()
..()
UpdateHealth()
proc
UpdateHealth()
for(var/S in stuff_to_delete)
del(S)
var/icon/result = new/icon('Arial7pt.dmi')
for(var/i = 1, i < lentext("Health: [HP]")+1, i++)
var/icon/I = new/icon('Arial7pt.dmi', "[copytext("Health: [HP]", i, i + 1)]")
result.Blend(I, function = ICON_OVERLAY, x = (i*7))
var/image/I = new/image(result, src, pixel_y = 40)
src << I
stuff_to_delete += I


Thats just a mockup. It's not meant to be copy pasted into your code, as it probably has some typos and compile errors. Just learn from it.
In response to Xerif
<small>Xerif wrote:
It's not meant to be copy pasted into your code, as it probably has some typos and compile errors. Just learn from it.</small>

How are you expecting someone to "learn" from faulty coding?

It does contain compiling errors: 3 errors, 0 warnings (double-click on an error to jump to it)
Page: 1 2