tommymaster Posted November 12, 2017 Share Posted November 12, 2017 (edited) Hi! I photoshopped a nice flat-looking login panel, but i only know how to attach click events to a button or stuff like buttons, but for example how should i make a script, that notifies me whenever i click on a button, that is right at the middle of the screen, and it's height is 100 and length is also 100? Edited November 12, 2017 by tommymaster Link to comment
Tails Posted November 12, 2017 Share Posted November 12, 2017 1. use the onClientClick event to detect mouse clicks (check the wiki) 2. within that event you can check for the mouse position (arg 3 and 4) or you can get it yourself with getCursorPosition() and multiplying the x and y by the your screen size (guiGetScreenSize) 3. check if the position is within your button's dimensions (mx > x and mx < x + w and my > y and my < y + h) Link to comment
tommymaster Posted November 12, 2017 Author Share Posted November 12, 2017 can i do it like i add a gui button, and make it transparent somehow, and after it i insert my image to it's place? Link to comment
Scripting Moderators thisdp Posted November 12, 2017 Scripting Moderators Share Posted November 12, 2017 Maybe my dxlib can help you. 1 Link to comment
ALw7sH Posted November 14, 2017 Share Posted November 14, 2017 You can create a gui behind your "dx button" and set it is alpha to 0. Or you could just use guiCreateStaticImage 1 Link to comment
tommymaster Posted November 14, 2017 Author Share Posted November 14, 2017 18 hours ago, ALw7sH said: You can create a gui behind your "dx button" and set it is alpha to 0. Or you could just use guiCreateStaticImage i was thinking about making a function for it, but then realised that i can't make click events for it, and cant destroy it anyhow, and use them as elemenets. I will take a look at dxlib if i can't work this out thanks for the suggestion. 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now