How do I make scrollable content ?

Get help using Construct 2

Post » Sun Sep 14, 2014 3:20 pm

Message: nemoidstudio is not yet permitted to post plain text URLS (300 rep required). 2 URLS removed. Why?
Hi there,

I have just started using construct 2, it looks very nice and we are considering using it for our new game. However one feature we need and I didn't find how to achieve is "scrollable content". What I mean by "scrollable content" is the same thing you can do in an HTML page on a DIV with the CSS property overflow set to scroll. For example .
I have found an attempt with construct described here: but it seems to only works with lines of text. What we need is to have any kind of content to be scrollable (sprites, buttons, etc.). It must also work on touch devices.

Any ideas on how we can implement this?
Thanks a lot.
B
4
Posts: 4
Reputation: 208

Post » Sun Sep 14, 2014 3:24 pm

Sorry the 2 links I had in my previous message were automatically removed.... :(
Search google for "css overflow scroll example" to see what i am trying to describe.
Search this forum for "[Behavior] scrolling (for text/sprite font plugin)" to see the example with text only.
B
4
Posts: 4
Reputation: 208

Post » Fri Sep 19, 2014 9:56 am

Hey,

So I tried to build such a widget myself.
I used a sprite with a DragDrop behavior attached set axes vertical only, pinned some other sprites on it to scroll with and added two sprites above and under with a blend mode set to source out to hide the scroll pan where you should not see it.
Better than words please look at the attached project to understand the trick I used.

There are still several problems :
- using the builtin DragDrop there is no momentum scrolling as you are used to see on touch devices
- scrolling doesn't end at the end of the pan
- having to add 2 sprites to hide content rather than 1 to make content visible is rather tedious. I dindn't find how to do the other way
- there is no scroll bar

I'd greatly appreciate comments on this and ideas on how to fix the above issues


Thanks a lot.
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 4
Reputation: 208

Post » Fri Sep 19, 2014 1:57 pm

@nemoidstudio

This is what i've got so far:

You're gonna need the Boundary behavior to open it.

Scrolling.capx



in your capx you could use the Boundary behavior to bound ScrollPan to a certian point where you can't scroll up or down.
You do not have the required permissions to view the files attached to this post.
B
22
S
6
Posts: 244
Reputation: 2,700

Post » Fri Sep 19, 2014 2:28 pm

@Wisdoms

Thanks for the Boundary behavior, one problem solved!
B
4
Posts: 4
Reputation: 208


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests