How do I create disappearing notifications

Get help using Construct 2

Post » Tue Jun 27, 2017 10:11 pm

Basically I would like to create disappearing notification type of boxes.
Scenario: Creating a game where you create a product and then sell it.
Intended Action: Looking to create a box towards the top right hand corner of the screen, showing name of product and profit. Multiple products can show up at once, so I would like the top one to disappear say after an in-game month and then any other products would move up the screen taking its place.
It would look similar to when you develop a game in game dev tycoon.

Any advice greatly appreciated.
B
8
S
1
Posts: 14
Reputation: 499

Post » Tue Jun 27, 2017 10:25 pm

Hi,

It is simply a box and a text on top of it, both with FADE behavior.

So after X happens you:
1) create the box on top right
2) create the text on top of the box
3) set the text what it should say

and you can set FADE to for example 2 seconds wait 1 second disappear and the 2 objects will go away by themselves

Good luck!
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.

My games & gaming portal = DolyGames

If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.

Cheers,

COSMOS
B
20
S
9
G
1
Posts: 75
Reputation: 2,152

Post » Tue Jun 27, 2017 10:42 pm

Thanks for the swift reply,
I was able to do that but what I was stuck with was after the top box disappeared, I wanted the second box under it to move up and take its place.
B
8
S
1
Posts: 14
Reputation: 499

Post » Wed Jun 28, 2017 3:56 am

I'd use an array; sort the array however and then pop a cell when a notification disappears.
Since the notifications' UIDs are based on their position in the array, they'll automatically move up.
e.g.
for 0 to array.Width
  pick notification with UID array.At(loopindex)
  set notification.Y to (0 + loopindex * notification.Height)

You can also use lerp or some other method to move them more gradually, but that means you have to set their position correctly when they are first created.

The fade behavior is for the visual effect, and the array takes care of the rest.

https://drive.google.com/open?id=0BzomH ... 2ZRQ2tTRVE
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Wed Jun 28, 2017 11:59 pm

you can always bullet anything to any location :)
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.

My games & gaming portal = DolyGames

If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.

Cheers,

COSMOS
B
20
S
9
G
1
Posts: 75
Reputation: 2,152


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests