Restrict the viewport

Get help using Construct 2

Post » Wed Oct 30, 2013 7:50 pm

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.
Rabenmutter2013-10-30 19:53:56
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Wed Oct 30, 2013 8:53 pm

What would be an acceptable solution?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Nov 01, 2013 10:21 am

^ 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...
B
10
S
1
Posts: 163
Reputation: 1,436

Post » Fri Nov 01, 2013 2:18 pm

:( 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.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Fri Nov 01, 2013 10:26 pm

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.
B
70
S
10
G
8
Posts: 24
Reputation: 8,836

Post » Sat Nov 02, 2013 12:17 am

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
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Sat Nov 02, 2013 7:37 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Nov 02, 2013 12:06 pm

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.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Sat Nov 02, 2013 12:10 pm

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: blackhornet and 30 guests