What do you mean by "it doesn't work"? What behavior are you seeing?
The first time you showed the code, you had the 'if discOn = 1' set of code after the other.
Also you can replace that bit with one line:
if GetTextVisible(2) != discOn then SetTextVisible(2,discOn)
In fact, you can can replace a lot:
// setup outside of loop
// assumes that you have already created Text(2)
discOn = 0
SetTextVisible(2,0)
// inside main loop
// discription button
if GetVirtualButtonExists(2) = 1
if GetVirtualButtonPressed(2) = 1
// flip the value of discOn
discOn = Mod(discOn+1,2)
// update the display of discription
if GetTextVisible(2) != discOn then SetTextVisible(2,discOn)
// make sure that we don't have extended button press
while GetVirtualButtonPressed(2) = 1 : Sync() : endwhile
endif
endif
Are you sure that the discOn variable isn't being set anywhere else?
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master