Compass for mobile phones

Discussion and feedback on Construct 2

Post » Mon Dec 02, 2013 5:30 pm

Has anyone tried to to make a working compass for mobile phones.
Would it be possible with geo locations ?

As someone who has done this, kindly like to share a example.

Thanx.
B
10
S
2
G
3
Posts: 25
Reputation: 850

Post » Mon Dec 02, 2013 5:54 pm

"Would it be possible with geo locations ?"

Not really, since you only have 1 point (and can rotate the display however you want).
What is possible would be determining in which direction you are moving compared to north pole, but since you can rotate your device as you want while moving, a compass-like behavior is not really possible (that you have a needle that always points northwards no matter how you rotate the device).
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Mon Dec 02, 2013 6:15 pm

Just use the Touch.Alpha expression.
Scirra Founder
B
415
S
248
G
92
Posts: 25,295
Reputation: 200,994

Post » Mon Dec 02, 2013 6:30 pm

Thanks for the replies. ( me happy )

It's even in the manual my mistake and thanx again Ashley.

The Touch object also provides input from the accelerometer (motion) and inclinometer (tilt/compass direction) if the device supports them.
B
10
S
2
G
3
Posts: 25
Reputation: 850

Post » Wed Apr 18, 2018 6:18 pm

Sorry to revive such an old post, but I've been doing some testing on this trying to come up with a compass and it seems to me the alpha value is relative, not absolute. That is, it shows the rotation in relation to an arbitrary point set, aparently, when the call is first made and not the the actual North itself.

Am I right? Is there any way to get the absolute North in Construct?

Thanks in advance.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 722
Reputation: 4,026


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest