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 / Using images as buttons

Author
Message
ElijahNomad
13
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 27th Sep 2011 16:56
Hi All, been reading the documentation but wondered if someone could give me a quick answer on using images as buttons. I'm using AppGameKit C++. I know there's examples in basic for windows but do all my development on Mac in Xcode. Thanks in advance.
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 27th Sep 2011 18:32
I can show you how I do it in Tier 1... I know you are working in C++, but it would be similar right? (I hope so anyway, I want to move my game over to Tier 2 eventually)...



Hope that helps...
ElijahNomad
13
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 27th Sep 2011 22:00
Hey Funnel, thanks for the tip. Ported your code to C++

If there is a better way to do this. Please let me know.
kirtn14
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 26th Nov 2011 15:40
i was reading this and tried this but how can i asign a sprite to the code please?

kirtnicholls
Reactor
15
Years of Service
User Offline
Joined: 6th Apr 2009
Location:
Posted: 21st Dec 2011 17:17
Have you tried using the AddVirtualButton button function, it will do the work for you...

You can customise the button with functions like:

SetVirtualButtonSize
SetVirtualButtonPosition
SetVirtualButtonImageUp
SetVirtualButtonImageDown


You can get the state of the button with functions like:

GetVirtualButtonState
GetVirtualButtonPressed
GetVirtualButtonReleased


There are examples in the examples/input/virtualbuttons folder

Hope this helps

==================================================
you gotta live to survive to be a hundred and five
==================================================

Login to post a reply

Server time is: 2024-11-22 20:41:37
Your offset time is: 2024-11-22 20:41:37