How do I turn an analog gamepad into digital? ;)

Get help using Construct 2

Post » Fri Mar 17, 2017 2:40 pm

I think I need to ask better question. :)

Imagine you have gamepad that output the d pad in analog values on axises.

But what you want to have is to have digital values!

What I want to have is when D-pad up is pressed: UP=1, D-pad Left = LEFT=1...
and if pressing on angle, then UP and LEFT = 1 rest 0 so to say.

How can I transform the axises into outputting those binary values?
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Fri Mar 17, 2017 2:57 pm

Nevermind I solved myself by reading rawaxis value (Gamepad.RawAxis(0,0) and (0,1)
Flooring the value Floor(Gamepad.RawAxis(0,0))
It will output -1, 0, +1..

Quite binary. Nice.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735


Return to How do I....?

Who is online

Users browsing this forum: biasaur, Unconnected and 10 guests