FoxyOfJungle
Kazan Games
It seems a little strange, but let's say I don't want to initialize a variable in the create event and just use the Draw event, is there any way to make that variable change without being started?
I managed to do something like this:
The problem with this code is that it can only be used once in the draw event for the same object.
Say I have a button and I want to modify its opacity, but I don't want to initialize the variable in the create event, how would I do that?
My goal is to use only one event, the Draw Event (yes, I know it's not appropriate, but I'm doing some tests...)
Thanks!
I managed to do something like this:
GML:
if !variable_instance_exists(object_index, "variable") var variable = 0; else var variable += 1;
draw_text(50, 50, variable);
The problem with this code is that it can only be used once in the draw event for the same object.
Say I have a button and I want to modify its opacity, but I don't want to initialize the variable in the create event, how would I do that?
My goal is to use only one event, the Draw Event (yes, I know it's not appropriate, but I'm doing some tests...)
Thanks!