It is a pain having to create new .bmp files for each new button you want to have on your display unless you have individual icons for each item, especially when it is in a HUD that is dynamic and includes over 200 items.
It would be infinitely appreciated if an icon_state parameter could be added to the image option in buttons and labels...
ID:133733
Feb 13 2008, 8:28 pm
|
|
Feb 13 2008, 8:34 pm
|
|
While we're at it and assuming that this isn't already supported in some way, it'd be nice just to be able to specify a certain portion of an image to focus on. I thought for one of my games it would be cool if players could upload their own interface image to change the whole look, until I realized that there was no way to set a specific object in the interface to a specific point on the image.
|
In response to Foomer
|
|
Exactly.
If this option isn't a possibility then making a workaround possible would be nice too... Example: If you generate a new icon datum just from that specific icon_state you can't pass that into the 'image' setting. If that was possible then it'd be easy to write up a line or two of code that yes, would be slightly resource inefficient, but still functional none the less. |
In response to AJX
|
|
AJX wrote:
If you generate a new icon datum just from that specific icon_state you can't pass that into the 'image' setting. If that was possible then it'd be easy to write up a line or two of code that yes, would be slightly resource inefficient, but still functional none the less. You have the right idea. Technically, this code should do what you want: mob/verb/buttonimg() But it doesn't, and the reason is that the server isn't smart enough to send over the modified icon to the client. You can fool it by assigning that icon to an object in use on the client, eg: mob/verb/buttonimg() This is obviously a hack, but I believe it'll do the trick. I'll attempt to fix things so that the first example works. Note: when testing this I just noticed that transparencies on these button images isn't working as I'd hoped. I'll look into that too. |
In response to Tom
|
|
What's funny about what you're saying is I did almost the exact same thing trying to create a workaround.
I set the user's icon to the generated icon, then tried using winset to set the button icon to the user's icon... However the result was nothing. If I set button image to the user's icon BEFORE changing it to the modified icon it worked fine, and generated the desired (almost) result. But it would not work as how you described for me. I'll give it another shot writing it a bit different, but I think it'll respond the same way it did last time. EDIT: Wow. Well, I will never question you again. It worked, but only when i used output not winset. Very interesting... Thank you very much for your help, I greatly appreciate it. |
In response to Tom
|
|
Don't forget the handy trick for caching dynamically-generated icons that the client hasn't yet seen.
|