Help with Wb3d_ButtonState

Blitz3D Forums/Blitz3D Programming/Help with Wb3d_ButtonState

Guy Fawkes(Posted 2009) [#1]
How do you say if 1 button = another button?

Like If Wb3d_ButtonState(button1) = Wb3d_ButtonState(button2) then..


Kev(Posted 2009) [#2]
If Wb3d_ButtonState(button1) And Wb3d_ButtonState(button2)Then

Endif



Guy Fawkes(Posted 2009) [#3]
No, I meant whats the exact command for this? Because this didnt work. I want to know how to cancel the 2nd button if the 1st button has been pressed.


Guy Fawkes(Posted 2009) [#4]
Here's my code so far:




Guy Fawkes(Posted 2009) [#5]
Anyone?


_PJ_(Posted 2009) [#6]
You mean like radio buttons?


Guy Fawkes(Posted 2009) [#7]
No. regular buttons. Wb3d_createbutton() is what i used.


Guy Fawkes(Posted 2009) [#8]
can anyone else help? =/


_PJ_(Posted 2009) [#9]
Well, I have no experience with Wb3d but from youre code example, you are only setting a local variable of Button4 to 0, not the ACTUAL Buttonstate.

Of course I dunno what function would 'unpress the button, or set the state but the function should be something like this:
Function is_pressed(button1, button2)

	firstbutton = WB3D_ButtonState(button1)
	secondbutton = WB3D_ButtonState(button2)

	If ((firstbutton) And (secondbutton))
;		WB3D_SetButtonState(button2,False) ; There should be a function to Set the button state to False? or 'Unpress'? Not sure what this is
		WB3D_Notify "","You can't select 2 particles at once.",0
	EndIf

End Function