referencing the center of the screen..

For questions about using Classic.

Post » Sat Feb 06, 2016 9:10 am

Hi all.

Is there a way to get a constant coordinate of the center of the screen? I would like to offset some objects within a scrolling background from the visible screen center, but it needs to work at varying resolutions, so referencing the visible screen edges seems unworkable.

initially I tried the following as a test

sprite : set x to scrollxleft+640

but that will only work in 1280 pixels wide resolution, it also juddered depending on what my scrolling was doing.. Ideally I need a method that would be rock solid.. can anyone offer advice?

thanks
B
11
S
4
G
5
Posts: 171
Reputation: 2,446

Post » Sat Feb 06, 2016 12:28 pm

With a invisible object in the center of the screen with the anchor behavior?
MY APPS ON GOOGLEPLAY
ImageImageImage
B
39
S
14
Posts: 100
Reputation: 2,928

Post » Sat Feb 06, 2016 12:55 pm

is this construct classic or construct 2 you are referring to? I cant see an anchor behavior in construct classic.
B
11
S
4
G
5
Posts: 171
Reputation: 2,446

Post » Sat Feb 06, 2016 3:00 pm

Sorry, I didn´t see the post was about classic. I was speaking about C2
MY APPS ON GOOGLEPLAY
ImageImageImage
B
39
S
14
Posts: 100
Reputation: 2,928

Post » Sat Feb 06, 2016 4:40 pm

If you use the window plugin then you could do something like,
sprite--> set x to scrollxright-(windowwidth/2)
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Wed Feb 10, 2016 4:25 pm

thanks for the response, but due to varying scroll ratio changes, it moves around..

is there a mathematical way of setting it relative from a layer that never changes scroll ratio?
B
11
S
4
G
5
Posts: 171
Reputation: 2,446


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest