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.

Newcomers AppGameKit Corner / [SOLVED] Scene Editor & Buttons. Can't get them to work.

Author
Message
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 22nd Aug 2020 10:03
I'm doing something really stupid I'm sure!

I have a button in my menu scene. It has a global variable set of 'Garage_powerbutton'

In my loop for the scene, I have for testing it:

if GetButtonPressed(Garage_powerbutton)
end
endif

The button gets clicked, but nothing happens.

What have I misunderstood?

Ta.

The author of this post has marked a post as an answer.

Go to answer

Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 22nd Aug 2020 10:22
Bugger... sorry.

So it does work if I click it on android. But it doesn't work if I mouse click it in windows.

Why would that be?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Aug 2020 15:59 Edited at: 22nd Aug 2020 16:10
This post has been marked by the post author as the answer.
are you sure you want a Button vs a VirtualButton?

Buttons are for emulating joysticks. if you have a joystick plugged in, that's where AppGameKit will look for the input. otherwise, with your code above, press <space>?

if you did intend to use a virtual button, see here. it might save you another headache.

i should add, i've never used Studio so i don't know how it presents "Buttons" within a Scene/what exactly to expect from them, there.
[My Itch.io Home] | [#LowRezJamAGK2020]
[AGK Resource Directory] | [TGC @ GitHub]
[CODE lang=AGK] Your Code Here [/CODE] | [VIDEO=youtube] VideoID [/VIDEO]
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 23rd Aug 2020 06:03 Edited at: 23rd Aug 2020 06:03
Thanks, I've changed it to getvirtualbuttonpressed() and it works on both now.

Login to post a reply

Server time is: 2024-11-21 13:09:38
Your offset time is: 2024-11-21 13:09:38