Restrict the viewport

  • Hi!

    Curenntly I'm trying to setup a highscore list in my game. The list should scroll up and down to see other players in the highscore. Everythings just working smoothly but when I scroll the highscore elements overlap the header and the bottom of my 9Patch Popup. Of course I could just use another Sprite on head and bottom and let the highscore entries disappear "under" this sprite. But this is not an acceptable solution for me.

    <img src="http://s14.directupload.net/images/131030/8avmvxxd.png" border="0" />

  • What would be an acceptable solution?

  • ^ I have to agree with the guy above, there don't seem to be any other ways to do this. Well, you could have a look at the z-order bar, or have the objects that need to be "under" into another layer entirely, but this pretty much is the same thing.

    Btw, if you'd like a smooth disappear effect, you could create a sprite with the edges blurred that would be below the header but above the objects in question, this would make it appear that the objects are gradually fading out...

  • :( Hoped there was another solution. Cause now I need to load extra sprites just to let the items disappear. I'm trying to user as less graphic ressources as possible.

    Would've been great if there's a possibility to set a layer size. If the items are out of the layersize, they disappear.

  • You could destroy each textobject and create a new one at the bottom, but you would have to keep track of the new textobject in order to set the text.

    Another way is for you to a use fix number of textobjects that will scroll up to fill screen plus 1 that is off screen at the bottom in the next positions to scroll onscreen. As the top one goes off screen, re-position textobject.Y off screen at the bottom of the column of textobjects. Then set text for that textobject to the next score before it scrolls on screen. Then there will always only be a set number of textobjects with set UID's that you loop through to set you next score to.

  • Wow, that are nice thoughts but this is more pain in the ass than putting just two sprites at the bottom :) But thanks for your ideas

  • would using an event is overlapping set visible is not overlapping set invisible help?

    or ofcourse set visibility based on y-coordinates.

    you could also take a look into blendmodes, to keep the background visible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Unfortunately this is not an option. I want to show "half" Highscore entries, so the user will see he can scroll.

    I will have a look at blendmode later and will tell you if I found a solution.

  • Blendmode would be the solution, youd have to have sprites on the top and the bottom though.

    Set them to destination out and the background beneath the highscore-field would be visible.

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