As far as I know the screen_loc applies only to movable atoms.And I was asking if images could be put on the screen(HUD).with a specified screen_location.
I am trying to put 'text' on my screen.Any newing objects for each and every letter, could make CPU fatigued.So I was asking if there was a way for putting images on the HUD and specifying their screen_loc.?
ID:273468
May 24 2010, 11:54 pm
|
|
Found One Way till now.
Steps: 1.Create a Single Object and place it in the HUD. 2.Add images to it as overlay,since images do support pixel_x and pixel_y on screen. Any other Better Ideas? |
In response to Garthor
|
|
Garthor wrote:
Of course, images are just as much objects as objs are, so there aren't really any efficiencies in using them over objs. at least it could be better 0.001%. The best solution is just to keep a global list of letters which have been created and are no longer being used. Remove from the list when you need some letters, add to it when you're done with them, and only create new objects if you need a new one and the list is empty. lol.But HUDs are not global.Each player has a HUD.And even if u mean creating the list for each player, then it could be more reasonable.But it shouldn't make much a difference as I am showing messages on the HUD which may take up all the 26 letters in the alphabets, but better than not doing so. |
In response to Soul Sign
|
|
...use a layer?
|
In response to Soul Sign
|
|
Soul Sign wrote:
1.Create a Single Object and place it in the HUD. The way you have it, a good amount of activity within the game using this way, will create some CPU usage that you'll most likely not want. You could make a list for the client (not mob, since mobs can be switched in-game, thus causing the list to be re-read or whatnot) containing every Number/Letter/Character /obj that you want, then adding them to their map screen when needed. This way, no real new /obj's are created, they are just added/removed. I haven't tried that way, but I will later on down the road. |
In response to Dark Vendetta
|
|
Dark Vendetta wrote:
You could make a list for the client (not mob, since mobs can be switched in-game, thus causing the list to be re-read or whatnot) Thats not what Lummox JR would say.He would say 'client' simply because making a list for each and every mob who need not be under a client can use up BYOND's resources. What you said was exactly as Garthor said(except for the point that you didn't consider multiple letter usage).But Whatever I still think and I strongly assume that making images take less CPU than creating an obj.However as Garthor said there wouldn't me much difference, I plan on merging Garthor and mine Idea.Doing the same what Garthor said but with images. Still any 'light bulbs' in anyone's head? |
In response to Soul Sign
|
|
Soul Sign wrote:
Thats not what Lummox JR would say.He would say 'client' simply because making a list for each and every mob who need not be under a client can use up BYOND's resources. Did I not say, "You could make a list for the client..." ? Same thing as "He would say 'client'..." What you said was exactly as Garthor said(except for the point that you didn't consider multiple letter usage). That's a matter of you configuring it to your specifications. Ex; If you want the word "Hello" at the bottom of your map, you'll need to display the letter H, then gather the position of H and calculate the next position for the next symbol and so on. I thought that was just enough common sense and I didn't have to say that. You'll have less power over images (I'll assume you mean /image) since you can't directly change pixel_x/pixel_y, screen_loc and etc. They are just images and aren't actual objects that can be modified. /obj would be more powerful in this case, and the combination with making it a client list (Like I said and you said LummoxJr would suggest) because client.mob can change within the game, causing it to run mob/Login(), mob/Logout() which would involve you removing the screen text or whatever, and then re-adding it. With a client list, you can easily gather client.mob's information (if using it for statistics or whatnot) and adjusting the already existent screen text to update. Either way, you'll want client list, and my recommendations for /obj instead of /image, for less limitations/complications and potentially less CPU usage. EDIT: Oh, I didn't seem to catch what you meant by multiple usages until now. I apologize, my brain is a bit confuggled from coming out of Summer Classes like Calculus. So yeah, you'll probably want to go with generating new /obj still, unless you can comprehend enough to alter /image. That, or you could create your own datums. |
In response to Soul Sign
|
|
Soul Sign wrote:
Garthor wrote: Your time would be much better spent elsewhere, then. The best solution is just to keep a global list of letters which have been created and are no longer being used. Remove from the list when you need some letters, add to it when you're done with them, and only create new objects if you need a new one and the list is empty. When a message is being displayed, you need a bunch of objects to add to the screen, one for each letter. When THAT SPECIFIC MESSAGE is no longer being displayed, those objects would be removed from the screen and presumably deleted. Instead of deleting them, move them to a list so the next time you need to display a message (for ANYBODY) some already-initialized objects are grabbed instead of having to create new ones. Also, adding "lol" to the start of that is immature and would have been offensive if you weren't so thoroughly ignorant, so cram it. |
The best solution is just to keep a global list of letters which have been created and are no longer being used. Remove from the list when you need some letters, add to it when you're done with them, and only create new objects if you need a new one and the list is empty.