How do I add inner scrollbars?

Get help using Construct 2

Post » Sat Feb 07, 2015 8:18 pm

I know Construct can use scrollbars but what I want is to have scrollbars active for a subset of the interface. I have attached a screenshot of a piece of code I'm working on. You'll note that there 10 textboxes with names in the textboxes on the left side and money amounts in the textboxes on the right side. I'd like to be able to scroll such that one could scroll through more than 10 textboxes while leaving the background in place. Also, I'd like to activate/deactivate the scrollbars based on whether or not there are more than 10 textboxes of info.
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 18
Reputation: 228

Post » Sun Feb 08, 2015 12:09 am

There's a tutorial for custom scrolling: https://www.scirra.com/tutorials/1217/c ... -or-slider
ImageImageImage
B
71
S
21
G
222
Posts: 3,652
Reputation: 124,733

Post » Tue Mar 10, 2015 5:05 am

So I just got around to attempting to implement said scrollbar feature. However, I now have a different issue. The scrollbar tutorial leaves the parts of the sprite not in the window visible. Is there a way to make whatever can be viewed within the window that is not currently within the window invisible while leaving everything that is not meant to be viewed inside the window visible? That way I can have many sprites, text boxes, etc. without the parts not within the window covering everything above and/or below the window.
B
4
Posts: 18
Reputation: 228

Post » Thu Mar 12, 2015 6:09 am

You can use 'Blend Mode'. To the demo, I've created a new layer, set it to 'Force own texture' = Yes, and moved 'content' and 'window' to that layer. For 'content' set the Blend mode to 'Source in' - it will disappear. Make a new Sprite ('windowClip') that is just a square that is slightly smaller than 'window' and center it in 'window'. Now right-click 'windowClip' and 'Z Order' -> 'Send to bottom of layer. 'content' will now be visible where it overlaps 'windowClip'.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
222
Posts: 3,652
Reputation: 124,733

Post » Mon Mar 16, 2015 2:12 am

Thanks for the new version. Another follow-up question: As per the screenshot included in my very first post in this thread, I'm looking to hide/show text boxes. Text boxes do not appear to have an Effects section where I can set the Blend mode to 'Source in' as you did with the 'content' sprite. How would I make text boxes disappear except when said text boxes are within the window?
B
4
Posts: 18
Reputation: 228


Return to How do I....?

Who is online

Users browsing this forum: plinkie, Vinterstille and 3 guests