Is it possible to winset an image to a label? If it is, could someone show me how?
If it isn't, some advice would be pretty cool. Here's what i'm trying to do: I have a skillcard with various information(using outputs, etc.) and one of them is supposed to be the avatar(the label, tried output).
Thanks for the help..
1
2
ID:160070
Nov 22 2008, 3:15 pm
|
|
In response to Alathon
|
|
oh wow, thanks! This will make things so much easier for me, especially since there are a lot of avatars.
I was working on this: |
In response to Axerob
|
|
You should call it the Ninja Info Card :P
|
In response to Alathon
|
|
How would you set the user's icon+overlays to a label?
winset(src,"ID","image=src") Like that? |
In response to Mizukouken Ketsu
|
|
No, because src is a mob, not an image. You would have to create one big image from their overlays and their icon with icon.Blend() and its ICON_OVERLAY/ICON_UNDERLAY function(s).
|
In response to Jeff8500
|
|
var/image/I = image(src) I HIGHLY doubt that'd work, but it couldn't hurt to ask if it will. xD If it doesn't could you give me a couple leads as to how I would do this? |
In response to Mizukouken Ketsu
|
|
Look up the mob/icon var >_<
proc/Fuse_Icons(mob/M) If they aren't considered atoms, you may need to use the : operator (or type cast them as whatever overlays are considered to be ancestors of, I'm not sure what BYOND thinks of their ancestry). |
In response to Jeff8500
|
|
They are a special type not documented. Lummox once said it's name. I can't actually remember it right now.
You need to use the : operator since there's no other way, I think. Edit- [link], Found it. |
In response to Andre-g1
|
|
proc/Fuse_Icons(mob/M) |
In response to Jeff8500
|
|
You should use a typecast variable instead of the : operator.
proc/Fuse_Icons(mob/M) |
In response to Xooxer
|
|
Okay it's only showing the text "/icon" in the label box. :\
//Xooxer's code |
In response to Mizukouken Ketsu
|
|
I think you need the \ref text macro before the icon reference. And, um. You're setting the text, what did you expect it to output?
winset(src,"Preview","image=\ref[Fuse_Icons(src)]") |
In response to Xooxer
|
|
WOW! lol I'm so blonde x.x Thanks Xooxer!
EDIT Now nothing is appearing at all :\ |
In response to Mizukouken Ketsu
|
|
Ah, right. This one is a bit trickier than that. You'll need to use fcopy_rsc() on that icon:
mob/Logging/verb |
In response to Xooxer
|
|
Now we're getting somewhere :) Unfortunately, I want only the current icon state, including any overlays added to the icon. What the label now shows me, I think, is every icon state the icon has in it's .dmi file.
EDIT I'm going to specifiy what I want out of this little learning session for clarity reasons. I have a verb assigned to a pushbox button that gives the user an icon. I want that icon's CURRENT state only, to appear in the label element. Next step. I also have a different verb assigned to a different pushbox button that gives the user hair. I want that hair overlay ADDED to the preview (again current icon state only). Hope that clarifies :D |
In response to Mizukouken Ketsu
|
|
Ah, you want to change the line in your Fuse proc to:
var/icon/I = new(M.icon, M.icon_state) You could also account for current dir there too. |
In response to Xooxer
|
|
It's still showing more than one icon state. Do I have to create a "still" icon state in the .dmi file rather than just keeping the movement icon state?
And it isn't including any overlays >.< Even when I added... var/icon/I = new(M.icon, M.icon_state, M.dir, M.overlays) |
In response to Mizukouken Ketsu
|
|
Which is because icon() and new /icon don't have a fourth arg for overlays...
|
In response to Mizukouken Ketsu
|
|
Hrm, so it seems you can't typecast from overlys. :/
proc/Fuse_Icons(mob/M) |
1
2
Labels have an 'image' parameter.
Ex:
winset(client, label_tag, "image='my_file.png'")