Scroll and scrollbars - issues

0 favourites
  • 5 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello.

    I am currently making a level editor for my game.

    I have simplified the capx to only show the editor portion.

    You can find it here.

    funnybunny.se/files/scroll.capx

    I am currently fighting with the scrolling of content.

    I found a thread on scrollbars here (I found another one but it was more flawed)

    construct.net/en/forum/construct-2/beginners-questions-19/scrollbar-web-page-111884

    And I used the content there and adjusted to my needs and also included a horizontal.

    I really tried to figure out the values and adjusted to what's relevant for my project.

    I am however struggling with two things. Naturally it all has to do with the calculations...

    * Start the capx.

    * Scroll far to the max on horizontal and/or vertical bars.

    You can see the gray background at the bottom/right. I don't want to scroll onto the gray background. it should stop at the brown edge.

    Second problem:

    The original capx didn't really have anything to go for the max size of the content?

    to showcase:

    *Start the capx.

    *Click on "NEW" button

    * Enter map size width: 14, Height: 63. (the min and the max respectively) and click on OK.

    Now try to scroll down as far as you can. You see it will stop before the area is finished.

    I use LevelWidth and LevelHeight to set the size of the level area (the workable area) and the TOOLBAR is a "constant" of the Toolbar width.

    Somehow I need to work these into the scrolling events.

    But sadly I am not best at calculations.

    So if you can help me solve these two problems above, I would be thankful!

    I will also need to solve the "pan with hand" later on, but it will be a later problem. (Likewise with the dragging while painting/selecting marquee etc)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't have any third party addons so I can't open your capx but here is one way to have a scrollable area with scrollbars and hand pan. It clamps to the Scrollwindow to the scrollArea but the scrollwindow has to be smaller than the scrollarea.

    dropbox.com/s/qshp8w4mmp1jzro/scroll_area.capx

    In concept you can have multiple scrollable areas. One per window, but the capx would need modifying to handle that.

  • Oh I forgot about checking if there's addons remaining in.

    I will 1. Look through your example and see if I can use it and adapt it.

    And if i fail, I will sanitize my capx. I forgot that aspect.

    Thank you for your reply, R0j0!

  • I opened your capx now. And I see it is quite different. I use scroll-to behaviour on an invisible object and parallax so I can work with X and Y coordinates as is with the editing content,also not having to pin things.

    I will see if I can somehow convert your idea to work with mine.

    Meanwhile, here's an updated version of my capx. Hopefully I have removed all the 3rd party plugins.

    funnybunny.se/files/scrollupdated.capx

    *returning to look at your capx*

  • I went back to my own capx and I managed to solve the constraints for the drag range by updating these two events.

    Whew!

    Now onto the hand tool!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)