ID:2023958
 
(See the best response by Ter13.)
Code:


Problem description:

This is the code

obj/HUD
say
layer = MOB_LAYER + 100
icon = 'HUD.dmi'
Click()usr.Run()

New(client/C)
screen_loc = "20,20"
C.screen += src


obj/HUD
Bag
layer = MOB_LAYER + 100
icon = 'Hud.dmi'
icon_state = "Inventory"

New(client/C)
screen_loc = "100,10"
C.screen += src


client
New()
..()
new/obj/HUD/say(src)
new/obj/HUD/Bag(src)



i haven't programmed in a while so i am back to zero at coding and this code gives me a black screen

in client/New(), you need to set the return value.

Change the line that says ..() to . = ..()
I tried the last one it doesnt work for some reason and what do u mean by return value
Best response
Wait, nvm, found your problem.

screen_loc = "100,10"

^I really doubt your screen size is 100 tiles wide. This is causing your screen to be shifted to the right by 3200 pixels.
ok
and btw can you help me redo my hud code because its not showing anything
when i add a new "New/obj/HUD/whatever" after the client/new it doesnt spawn the second one