mob
verb
show_text(msg as text)
TEXT(msg, 1, 3, 40, 0, "CHAT",32)
obj
letter
layer = 11
icon = 'HUD - Font.dmi'
New(letter)
..()
icon_state = "[letter]"
mob
var
list
TEXT = new
proc
TEXT(string, loc_x, loc_y, pix_x, pix_y, LABEL = "none")
var
slength = length(string)
txttrack = 1
index = 1
while(slength--)
var/letter = copytext("[string]",txttrack++, txttrack)
var/obj/letter/l = new(letter, pix_x, pix_y)
l.screen_loc = "[loc_x++],[loc_y]"
l.pixel_x = pix_x
l.pixel_y = pix_y
TEXT["[LABEL][index++]"] += l //keep track of text on screen
client.screen += l
Problem description:
I'm trying to make text on screen, however I was hoping not to just simply increase the screen_loc x variable for each letter, as this is very large spacing.
Instead I just want the increase the pixel offset of x by a certain amount. However all that I'm really struggling with is why does altering pixel_x or pixel_y in any manner not do anything?
pixel_x/y alter the display of an atom on the map. If you want to change the pixel offsets in the screen, you need to use the special screen_loc syntax:
So you would do:
Also, instead of increasing loc_x with each character, you need to increase pix_x by the width of the character, and then when that reaches a certain threshold, convert that over to loc_x.