ID:174014
 
I have an object called HUD. It is as multi-tiled [bigger than 32x32] PNG. When I set it's screen loc, however, it scrunches it all up:

mob
proc
AddHUD()
new /obj/HUD/Body(src.client)

obj
HUD
Body
icon='body.png'

first question:
With world view of 8, how can I get it to show up in the uppermost right hand corner? The icon is 93x217 pixels.

second question:
How can I get it to not be scrunched up?

THanks a bunch!


<-Airjoe->
well, first of all, look up the screen_loc variable

second, resize the image, 96 by 224 is the nearest 32 pixel size. now, here's the dilly, you are going to have to do something like this:

for(var/count=0;count<(3*7);count++)
var/obj/HUD/body/B = new()
B.icon = 'whatever.png'
B.icon_state = "0,0"
B.screen_loc = "[(17-7)+count],[17-(round(count/7))]"
B.layer = 1000
B.name = "name"
usr.client.screen += B

the screen_loc is the place where the object appears, look it up, it's useful. YOu can even use pixel offsets on it.
In response to Ter13
I didn't show all the code before. I know about screen_loc.

obj
HUD
Body
icon='body.png'
New(client/C)
screen_loc="10,1"
C.screen+=src


im trying your code now.
In response to Airjoe
runtime error: Maximum recursion level reached (perhaps there is an infinite loop)
To avoid this safety check, set world.loop_checks=0.
proc name: New (/obj/HUD/Body/New)
usr: Airjoe (/mob)
src: Body (/obj/HUD/Body)
call stack:
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
...
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(null)
Body (/obj/HUD/Body): New(Airjoe (/client))
Airjoe (/mob): Login()

with this:
obj
HUD
Body
icon='body.png'
New(client/C)
for(var/count=0;count<(3*7);count++)
var/obj/HUD/Body/B = new()

B.screen_loc = "[(17-7)+count],[17-(round(count/7))]"
B.layer = 1000
B.name = "name"
C.screen += B


mob
proc
AddHUD()
new /obj/HUD/Body(src.client)

mob
Login()
..()
AddHUD()

Please help!
In response to Airjoe
Upper right hand corner would be world.maxx,world.maxy that would put a single icon at the top corner. For your hud in general look up dantoms ScreenBuilder demo/lib its VERY good for a visual way to add a hud overlay screen. Basically you visually build your in the map edit just like it should look in the game and when you run it it does it all for ya. Very nice little lib and easy to implement and use.
In response to Aridale
Are you completely ignorant?

The upper right corner of the SCREEN is not world.maxx!

His screen is view 8, meaning is it 17x17! this means that the upper right corner is 17,17!

You didn't read the full post, or understand it.

Heres an example: I have a screen sized at 17x17, I have a map with maximum dimensions: (10,10,1) I make the object's screen loc to "[world.maxx],[world.maxy]" Now, the object appears at 10,10. NOT the upper right hand corner, now imageine if you have a map with 50x50 dimensions, or even 1,000, then you can't see the image anymore.

What you offered in advice could actually have set him and others back. Just read the full post next time, before you respond, anyway, no harm done.
In response to Ter13
Whoa there, it is good to point out when someone is making a mistake, but you don't need to bash him for it. Even I make mistakes sometimes (Yes, as hard as that is to believe, it is true.) and need to be corrected. Just try to go easy on people, he probably had a limited bit of knowledge on the subject and thought he knew what he was talking about, either that or for some odd reason he misunderstood the topic.

I do agree that people should not reply with something which could set the person needing help back. Too many people do that and it is counter-productive.
In response to Loduwijk
I did not insult him badly, ignorance can be fixed, I was going to say stupid, but hang on... Uh oh... his key was formed on 9/1/2003... okay, I will apologize for the comment. I will not, however remove it, I will take full consequences, whatever they may be for what I did say.

I am sorry for the comment now, I did not, at the time think I was insulting him, until I saw the post again, I just kind of wrote it on the fly... sorry.