ScrollTo Issue

Discussion and feedback on Construct 2

Post » Thu Aug 01, 2013 11:34 pm

I would post up my CAPX, but I just can't as it's a completed game.

Here is my issue. I have a Layout that is 1100,800 and window size is 960x640. On start of layout I am setting scrollto x to 550, and scrollto y to 400 so the window is centered on my layout.

I cannot get it to work. I have checked and doubled checked every object to make sure they don't have a scrollTo behavior. I even opened up a compiled c2runtime.js file in notepad++ to make sure nothing had a scrollto behavior.

This is an existing game that I just recently changed the layout and windows sizes on it. I tried the above on all 4 of the existing layouts (each with their own event sheet) and it just won't center.

However, if I created a new layout in the project with a new event sheet it works fine.

Could I be overlooking something on my existing layouts? I do this pretty much in all of my new projects (to allow for various screen sizes) and I have never had a problem until now, so I have to just be missing something.

Thanks.
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Fri Aug 02, 2013 12:38 am

What happens when it "doesn't work"?
I have occasionally come across mysterious problems that I can't recreate and never figure out why they happen on my large project. It is most likely something you're overlooking but we can't rule out the possibility of a bug.
If I were to try and figure it out, I'd copypasta the project/capx (just so I don't instinctivly press CTRL+S by mistake lol), and open a layout where this bug occurs, and begin deleting things chunk by chunk, sprites and events, and when you realise your Scroll event works after deleting some stuff, you can CTRL+Z and delete less, and eventually pinpoint exactly whats going on. If you eventually get to a blank layout with no events and few sprites except the scrolling event, then yeah that's a bug lol.
Hope this is a useful idea for you!
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Fri Aug 02, 2013 12:54 am

Thanks, what happens is it doesn't scroll to the point I am asking it to, in this case the center of the screen. The window just focuses on the upper left as if there is no scrollTo events.

I've had weird stuff happen too and the only fix was the basically start from a fresh project. Might have to do that :).

ArcadEd2013-08-02 01:00:49
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Fri Aug 02, 2013 1:04 am

Figured it out, on the non working ones the Parallax was set to 0,0

I wonder if the version of C2 I was using when I first started this project defaulted the parallax to 0,0 and now it defaults to 100,100

:)ArcadEd2013-08-02 01:06:46
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests