How do I track X/Y in Window vs. Layout (solved)

Get help using Construct 2

Post » Thu Dec 29, 2016 4:56 pm

Hi there,

So I have a situation where I'm trying to make it where I can track where I am in the Window to control visual display. However at any time in the game my layouts might be much bigger than the window... so if i have a window that's say.. 1136x640.. but my layout is 3000x3000.. the problem i face is that i only seem to be able to get the layout x and y of my Touch position..

http://part12studios.com/temp/Games/Fin ... gerKing01/

notice how if i move over to the right of the screen.. the arm adjusts its position.. but this is currently based on the X of the layout.. which would be fine if my Window was also the same size but the logic breaks down when layouts become bigger than the window.

Thanks!
Caleb
Last edited by part12studios on Fri Dec 30, 2016 1:13 am, edited 1 time in total.
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Thu Dec 29, 2016 5:14 pm

I don't really see the problem, but you can get the X/Y based on the layer for Touch. Also there are System CanvasToLayer and LayerToCanvas expressions for converting coordinates between layers.
ImageImageImage
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845

Post » Thu Dec 29, 2016 5:17 pm

@blackhornet ok i see those. i'll mess around with it.. yea the visual isn't terribly off but the issue was irking me because of this kind of situation:

take the player finger quickly over to the far right of the screen.. then quickly shoot to the left and the issue is that the arm is still pointing upward which would be unnatural for the player relative to the position of the body shadow. I'll research those and see if those do the trick and report back!

Thanks,
Caleb
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Fri Dec 30, 2016 1:08 am

ah ok yes now i get it.. yes the touch.x did the trick.. don't know why i didn't think of that.. ugh.. thanks! :)
B
59
S
9
G
1
Posts: 939
Reputation: 6,545


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests