How do I move this object the first time?

0 favourites
  • 3 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • I'm trying to create some UI elements for my game. A scroll box is going to be important for navigating an arbitrary long list of objects. So I have the scrollbox built and sitting outside of the layout and all of the objects (except the scrollbar) is pinned to one item and I move that item. So when I click the button I have an event that moves the main window and the scrollbar (in that order) into the window but for some reason the scrollbar isn't put into the correct position. If I click the button a second time, then the scrollbar gets moved.

    Can someone explain to me what's going on and how to make it behave as expected?

    Secondary questions: Why are there lines on my 9-patch windows and orange scrollbar? If I change the mode to exact these lines become even more prominent. The larger gray bar is not translucent and does not seem to have that line.

    Why does the button play the press animation on loadout start? Initial animation is set to "None" and the only animation in the animation list is "Press".

  • I can't see the object names in your events but it looks like you have the ScrollBack sprite pinned to the MenuWindow. When you click the button you move the MenuWindow to 120,120 but things pinned to it won't have their position updated until after the whole event sheet runs. You're setting the scrollbar to ScrollBack.X before ScrollBack moves.

    [quote:1y3ve1e6] Initial animation is set to "None" and the only animation in the animation list is "Press".

    If you don't have an animation called "None" then it's going to play the first animation that you do have. If you don't want the animation to play you can set it's speed to 0 in the animation properties or you can stop the animation on start of layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried using a pin event to pin the scrollbar at start to the window so it gets moved like everything else and unpin in the same event but the behavior is the same. I also tried creating a subevent thinking that maybe the primary event needs to finish executing first but still no luck.

    I ended up settling on just forcing it to the X value of the scrollbarback every tick. I suppose I'll need to figure out how to move it to the top every time the window is summoned.

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