Parralax Scrolling and touch

Get help using Construct 2

Post » Tue Feb 26, 2013 2:19 pm

I'm trying to create an analog stick that works with touch screen devices. An issue I can't seem to get around though is the scrolling motion.

In the version I have uploaded, the stick is moved on the HUD layer, when the users touches the HUD the stick moves to the touched position. (This also works with mouse)

When I start the game in full screen (Scale) and click, the analog doesn't position itself correctly, its almost as if the parallax has failed.

Any help to why this is happening would be greatly appreciated.

Capx
https://dl.dropbox.com/u/74175978/Test_Parralax_Touch.capx
B
13
S
2
Posts: 87
Reputation: 1,244

Post » Wed Feb 27, 2013 9:04 am

I've tried a few things out.
If I set the full screen to crop the touch device works as expected
If I set the full screen to anything else then it seems the touch device isn't pointing where I click.
I have tried playing with the scale rates with no success. Any help would be greatly appreciated
B
13
S
2
Posts: 87
Reputation: 1,244

Post » Wed Feb 27, 2013 4:44 pm

Having no luck here, testing everything from scale rates, to moving the objects to different layers.
I worked out it has something to do with the full screen and touching the a layer with 0,0 parallax. Its as if the screen warps itself on a different parallax.
If you download the capx, just click anywhere and you'll see what I mean
B
13
S
2
Posts: 87
Reputation: 1,244

Post » Wed Feb 27, 2013 8:43 pm

Richard, instead of using Touch.AbsoluteX and Touch.AbsoluteY, have you tried using Touch.X("HUD") and Touch.Y("HUD")? These give you X and Y co-ords that are adjusted for the scale, parallax, etc. of the specified layer ("HUD" in this case?

Here is a capx that works (I think)

Docs on the touch object including the Touch.X("Layer") and Touch.Y("Layer") functions can be found here.
B
11
S
2
G
3
Posts: 10
Reputation: 3,026

Post » Thu Feb 28, 2013 9:10 am

@BStateham
Works perfectly now, I've read through the touch documents 100 times yesterday pulling my hair out for how to restrict touch to the touch layer. Don't know how I missed it.
Thanks for the advice
B
13
S
2
Posts: 87
Reputation: 1,244


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 29 guests

cron