fairyoggy Posted May 23, 2019 Share Posted May 23, 2019 addEventHandler("onDgsMouseClick", root, function() local sw, sh = guiGetScreenSize() local px, py = sw/1920,sh/1080 local myfontt = DGS:dgsCreateFont( "fonts/Roboto-Medium.ttf", 9 ) if source == buttont then if (DGS:dgsCheckBoxGetSelected(v11) ~= true) and (DGS:dgsCheckBoxGetSelected(v12) ~= true) and (DGS:dgsCheckBoxGetSelected(v13) ~= true) and (DGS:dgsCheckBoxGetSelected(v14) ~= true) then vibot1 = DGS:dgsCreateLabel(210,130,20,40,"Choose Answer!",false,vopros1) DGS:dgsLabelSetColor ( vibot1, tocolor(255, 0, 0, 255 ) ,true ) DGS:dgsSetFont(vibot1,myfontt) playSoundFrontEnd ( 4 ) else ... Hello! If checkboxes = false then Label and sound appears BUT If you press the button without releasing the left click(mouse) It works fine, but when you release the left mouse button then Label and sound are played again. How to fix it? Link to comment
justn Posted May 23, 2019 Share Posted May 23, 2019 addEventHandler("onDgsMouseClick", root, function(btn,state) local sw, sh = guiGetScreenSize() local px, py = sw/1920,sh/1080 local myfontt = DGS:dgsCreateFont( "fonts/Roboto-Medium.ttf", 9 ) if ( state == "down" ) then if source == buttont then if (DGS:dgsCheckBoxGetSelected(v11) ~= true) and (DGS:dgsCheckBoxGetSelected(v12) ~= true) and (DGS:dgsCheckBoxGetSelected(v13) ~= true) and (DGS:dgsCheckBoxGetSelected(v14) ~= true) then vibot1 = DGS:dgsCreateLabel(210,130,20,40,"Choose Answer!",false,vopros1) DGS:dgsLabelSetColor ( vibot1, tocolor(255, 0, 0, 255 ) ,true ) DGS:dgsSetFont(vibot1,myfontt) playSoundFrontEnd ( 4 ) else 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