• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Button not drawing correctly

Z

Zefyrinus

Guest
Hi! In my game (in GM 6.1) I have a clickable button which should look as if it's pressed down while you're clicking it. The button itseld is an object and it has two subimages and a variable frame that tells which subimage should be drawn. In the mouse press left event I do this: frame = 1; and in the mouse release left I do frame = 0;. In the draw event I use the D&D thingy to draw subimage frame.
In the game everything starts out right, but when I click the button it stays depressed, that is, it switches to frame 1, but never switches back to 0 when the mouse button is released. Is there maybe something about these mouse events that I have overlooked?
 
A

Aura

Guest
Any particular reason for why you're still using GM 6.1? Upgrade to the Standard version of GM:S ASAP. It is free and is far better than the version you're using in terms of functionaliy.

Either way, we need exact information to be able to help. Use the Show Information button and copy-paste the contents here.

Also, why are you using a custom variable instead of image_index? The following method should do what you want.

Create:
Code:
image_speed = 0;
Left Pressed:
Code:
image_index = 1;
Left Released:
Code:
image_index = 0;
And you won't need the Draw event anymore.
 
Z

Zefyrinus

Guest
Because I started with this game project eight years ago. I'll download a newer version of GM before I start on any new project.

Huh, it never occurred to me there was a variable like that. I'll try that. Thx!

As for the show information button, what's that? Are you sure it's in GM 6.1? I'll have a look and see if I can find it...
 
Top