Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Virtual Buttons

Author
Message
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 4th Sep 2011 22:49
Hi! Why can't I define the width and height of virtual buttons independently? Just a square size... it makes it hard to make a virtual button that says "Resume Game" when it also will have to be as high as the text is long...

Is there a good way to make a sprite into a button you can press with the mouse, or your finger? I am making a game framework, with pause, menu, quit, resume, credits and intro screens that I can use for any game I will make. All the "booring" stuff that goes around a game. This way I can more easily finish a game, since all the booring parts are predefined in the framework

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 5th Sep 2011 00:51
Load up the example file on Input>HittingSprite.

That will give you most of what you need to make your own button.

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 5th Sep 2011 04:21 Edited at: 5th Sep 2011 04:37
I made my virtual buttons invisible and put the graphics for it on the background image.
I only use 2 virtual buttons so far on my board game.
One is for the help (?) and the other the exit (x) with the (x) serving a double as the exit for the help screen too.
I put in a simple y/n confirmation for the exit for the app itself.

The size didn't matter much for those buttons since they are at the top of the screen anyway.
I made the diameter the same as the width of the graphic then made sure the bottom was right.
So, if you click just above it then it registers the click, but that is okay for what I am using them for.
If you use a round graphic for the button then it works much better than using squares or rectangles.

Another thought might be to use multiple buttons for the rectangle. (see attached image)
I haven't tried this method yet, but it should work.
The only thing to keep in mind is the 12 button limit on the screen at the same time.

Attachments

Login to view attachments
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 5th Sep 2011 11:20
Thanks Rich, I'll check that out when I get home from work. I wonder what happens if the button is placed over other sprites, will it register the one with the lesser depth value first?

CE, that was a very creative way to get it done, with the multiple buttons, wow, your smart I like your way of thinking out of the box.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.

Login to post a reply

Server time is: 2024-11-21 16:03:19
Your offset time is: 2024-11-21 16:03:19