I'm having some issues with the Mouse Clicked event. I want to try and make it so that if a player clicks a units portrait, I can trigger an event, but I've been having a large amount of difficulty. One event seems to register it fine, the 'Camera Moves' event, (when I use the 'selection' reason), but I can't specify a specific unit like that, or have it register for any player.
Therefore, I've been trying to get it so that if a player clicks within certain UI coords, it'll register...but for some reason, if the bottom of the screen is clicked, no event is triggered.
I didnt really test this, but just out of my head its possible that mouse clicked events wont be registered if the default sc2 UI is involved. So for example it wont detect if you click a button on your command card or a minimap button.
Since the portrait is some sort of button aswell its possible that the event just doesnt get triggered at all. If thats the case you could try to make a workaround by creating an invisible button above the portrait. Problem with this could be the different screen resolutions. Best way to achieve this would be to use the bottom right anchor since the command card should stay the same size for all resolutions.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm having some issues with the Mouse Clicked event. I want to try and make it so that if a player clicks a units portrait, I can trigger an event, but I've been having a large amount of difficulty. One event seems to register it fine, the 'Camera Moves' event, (when I use the 'selection' reason), but I can't specify a specific unit like that, or have it register for any player. Therefore, I've been trying to get it so that if a player clicks within certain UI coords, it'll register...but for some reason, if the bottom of the screen is clicked, no event is triggered.
@Zetal: Go
I didnt really test this, but just out of my head its possible that mouse clicked events wont be registered if the default sc2 UI is involved. So for example it wont detect if you click a button on your command card or a minimap button.
Since the portrait is some sort of button aswell its possible that the event just doesnt get triggered at all. If thats the case you could try to make a workaround by creating an invisible button above the portrait. Problem with this could be the different screen resolutions. Best way to achieve this would be to use the bottom right anchor since the command card should stay the same size for all resolutions.