Hexa Posted December 8, 2012 Share Posted December 8, 2012 (edited) Hello there. I am wondering why my code below isn't working. Well, I want to set selected to 1. As you can see on line 9, I am trying to set variable to 1 but it doesn't. But actually, variable setting on line 48 works. The rest doesn't. Hope you understand me. SOLVED. Thanks in advance. Edited December 9, 2012 by Guest Link to comment
50p Posted December 8, 2012 Share Posted December 8, 2012 We don't see the rest of the code. It's simply not working because the comparison is wrong. We don't know the coord of what you're comparing. You have to debug it yourself. Since you're using onClientRender, I'd use dxDrawText to show where the mouse is and where the intersecting rectangles are. Then you'll see why it doesn't work. Link to comment
Hexa Posted December 8, 2012 Author Share Posted December 8, 2012 (edited) Code is correct. I just wanna set variable but it doesn't set except for last one. Here are some screenshots. Clicking on icon #1 - Stats Link deleted. outputChatBox: nothing. Clicking on icon #2 and #3 - same as icon #1 Clicking on icon #4 - Settings Link deleted. outputChatBox: clicked4 - Works fine. Edited December 9, 2012 by Guest Link to comment
50p Posted December 9, 2012 Share Posted December 9, 2012 I get it now. It doesn't work because even if icon #1 worked fine your function will carry on executing and eventually it will reach line 54 which sets it back to 0. You should add "return;" to each "if" statement (NOT "else") and it should be fine since you don't want to check other bounding boxes once the mouse is inside of one of them. Link to comment
Hexa Posted December 9, 2012 Author Share Posted December 9, 2012 Ah, I should've know that... I'm so dumb Thank you, 50p. 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