During a game, the user can click on a button on the left. But only if the X-coordinate of the mouse is below a threshold, which is the width of the left-anchored panel.
How can we test this condition ? (using the variable mouse_x I suppose and if possible without a hard-coded value)
GUI optimization
GUI optimization
Damien Gerard
Ta3d & Yuni Developer
Ta3d & Yuni Developer
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
you could test if the cursor is on a window of the GUI system but it would only work in 640x480 because the panel height isn't infinite. You could also get the width of the panel from its WND object but you'll need to know which object it is which isn't obvious if you don't hard-code it somewhere ...
If you don't like hard-coding the panel width you can add it as a variable in ta3d.mod for example (so mods can change it) and give it a default value of 128 which is the one used in TA.
If you don't like hard-coding the panel width you can add it as a variable in ta3d.mod for example (so mods can change it) and give it a default value of 128 which is the one used in TA.
=>;-D Penguin Powered
Who is online
Users browsing this forum: No registered users and 25 guests