Scrolling Limit?

Get help using Construct 2

Post » Thu Aug 06, 2015 2:33 am

Okay so i want to create a sprite that is larger than the screen window. It is going to play the role as a menu that scrolls from left to right on touch. I have followed this Tutorial https://www.scirra.com/tutorials/560/sw ... tia?page=3

It was great and works fine the only thing is that i want part of mine off screen therefore got rid of bound to layout. I want to be able to scroll 500 off the screen to the left and 500 off the screen to the right as I don'n want all the options visible on the screen at one time. How can I do this?

Note: I am only using the X axis.

The image below should help explain what I mean

THANKS

Image
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Aug 06, 2015 4:02 pm

We do this with our galaxy.

You have to do some kind of debug Text object (that is on a 0 scale/0,0 parallax layer) then have it Text: Set Text: scrollBarBackground.X

That way, you can determine exactly which X-coordinate you need to tell it to stop at.

Then, you simply have an event like:

Compare two parameters:
scrollBarBackground.X < minX
-----scrollBarBackground: Set X to minX

and

Compare two parameters:
scrollBarBackground.X > maxX
-----scrollBarBackground: Set X to maxX

Make sure you Pin any subsidiary objects to the scollBarBackground.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Thu Aug 06, 2015 4:09 pm

@gumshoe2029 I'm quite confused on the first part. I've never used anything like that before. Is there any way you can show me?
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Aug 06, 2015 4:19 pm

Last edited by gumshoe2029 on Thu Aug 06, 2015 4:26 pm, edited 3 times in total.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Thu Aug 06, 2015 4:19 pm

@gumshoe2029 thanks so much
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Aug 06, 2015 8:30 pm

@gumshoe2029 Works great! :D thanks so much!
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Sat Aug 08, 2015 5:30 pm

np, glad to help.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: newt and 16 guests