Hey guys. I'm making a hero selection system and have come across a problem. When the image of a hero's portrait is selected, it will choose that hero for a given player. However, I am unable to get the button and image dialog items to work correctly. No matter the order or options I select, it seems that I can never have a button that looks like an image (no hover image, etc...). Does anyone have any suggestions?
The reason why setting a buttons image/hover image has such bizarre results is actually for a good, practical reason.
If you've scrolled through the /images that blizz provides by default you will have noticed a number of images that are all little 'parts' of either buttons or borders or other crap like that. It looks messed up and you probably though "well those look like nice buttons but how could I arrange those parts into a real button?"
Well if you haven't figured it out by now, what the game does with your "set last created dialog item's image" and "hover Image" is take those messed up images and cut them into pieces, rearrange them and put them where they need to be. It does this so you can have buttons of any size without any stretching. This also works if you want to create a custom border. You may have noticed the "Image type" category under the properties of "Create Dialog Image". Well that corresponds to the way the image will be sliced, diced and put together. All those messed up images are usable, you just have to figure out which ones are buttons, which are borders, which are horizontalborders, which are end caps and so on. The main Dialog's frame can also be easily changed through "Set Dialog Background".
Obviously this means you cannot use a static image as a button. But what I just do is set the button to a simple, transparent, white button and throw the image in behind it.
If you want to find a specific type of image just remember this:
to search for buttons just enter "pressed"
to search for borders enter "frame"
Please people... stop using the defaults. They're fugly.
Have you tried using Screen Buttons? I find them way easier than messing around with Dialog Item buttons. And it's a fairly simple trigger, this is from my custom UI (attached at bottom):
Hey guys. I'm making a hero selection system and have come across a problem. When the image of a hero's portrait is selected, it will choose that hero for a given player. However, I am unable to get the button and image dialog items to work correctly. No matter the order or options I select, it seems that I can never have a button that looks like an image (no hover image, etc...). Does anyone have any suggestions?
Instead of creating a button holding an image, or trying to, just create a button and over that an image.
It doesn't seem to detect clicks if I do that.
It does. Try this code (note that I didn't save the Dialog & Dialog items into variables because for this small demonstration there is no need to be):
The button and the image have the same sizes and the same offset. You can click the button (you should hear the sound). Or create a second trigger:
The reason why setting a buttons image/hover image has such bizarre results is actually for a good, practical reason.
If you've scrolled through the /images that blizz provides by default you will have noticed a number of images that are all little 'parts' of either buttons or borders or other crap like that. It looks messed up and you probably though "well those look like nice buttons but how could I arrange those parts into a real button?"
Well if you haven't figured it out by now, what the game does with your "set last created dialog item's image" and "hover Image" is take those messed up images and cut them into pieces, rearrange them and put them where they need to be. It does this so you can have buttons of any size without any stretching. This also works if you want to create a custom border. You may have noticed the "Image type" category under the properties of "Create Dialog Image". Well that corresponds to the way the image will be sliced, diced and put together. All those messed up images are usable, you just have to figure out which ones are buttons, which are borders, which are horizontalborders, which are end caps and so on. The main Dialog's frame can also be easily changed through "Set Dialog Background".
Obviously this means you cannot use a static image as a button. But what I just do is set the button to a simple, transparent, white button and throw the image in behind it.
If you want to find a specific type of image just remember this:
to search for buttons just enter "pressed"
to search for borders enter "frame"
Please people... stop using the defaults. They're fugly.
@DaemonicKing: Go
Have you tried using Screen Buttons? I find them way easier than messing around with Dialog Item buttons. And it's a fairly simple trigger, this is from my custom UI (attached at bottom):
Every button on my UI is a Screen Button, and they're all functional.
It still doesn't seem to work.