Game screen flashes black when clicking on GUIs (SOLVED)

Started by Secret Fawful, Mon 02/12/2013 23:07:16

Previous topic - Next topic

Secret Fawful

Anytime I click on a GUI in my game, the screen flashes black for a split second. This has not always happened. I've looked through all instances of ProcessClick, eMouseLeft, on_mouse_click, etc. that I can think of. I've deleted extra GUIs I was experimenting with. I've checked all of my modules' code. I can not, for the life of me, figure out what is causing this, or how to stop it. Any suggestions at all where to look or things to try? At first, I thought it was just my new iconbar doing it, but I tested the other GUIs, and they all do it.

m0ds

Did you check in repeatedly_execute (in global script)? Just an idea, but things there that are looping can cause screen/GUI flashes from what I remember. Also check in your main game tab, what are GUI's doing when they're disabled, disappearing? Going gray? Cos if you have something set to turn off a GUI but your main game thing says "Always show" there might be some conflict? (though I can't think what myself).

Secret Fawful

All of that stuff is working properly. Repeatedly_execute does not have any lines of code in it related to the GUIs. The GUIs are set to normally on. I still haven't found the root of the problem.

monkey0506

#3
I was highly suspicious of your on_events. Turns out that calling FadeIn will actually set the screen to black and perform the fade-in, even without a prior (matching) call to FadeOut. You entirely foolish person, you forgot your braces. on_event is called every time the user clicks or releases the mouse over a GUI... haha

P.S. Warning to the wise:

Code: ags
if (condition)
  player.PlaceOnWalkableArea();
  FadeIn(200);


Is exactly equivalent to:

Code: ags
if (condition)
{
  player.PlaceOnWalkableArea();
}
FadeIn(200);


If you want to execute more than one line of code conditionally or as part of a loop, you must make sure you are using braces! ;)

SMF spam blocked by CleanTalk