How do I create image-map with touchable areas?

Get help using Construct 2

Post » Mon Feb 16, 2015 12:29 pm

I have a gameover screen with 3 buttons - replay, highscores, back. The screen is one big png, so in fact there are no buttons, it's just one picture.
Can I capture where on the sprite the user touched (something like in this html example, but with touch control)?
Is there any impact on performance creating 3 transparent sprites over those button areas or is there a workaround which could be done with just events?
ImageImage
B
25
S
6
G
8
Posts: 774
Reputation: 6,650

Post » Mon Feb 16, 2015 12:41 pm

No impact at all with 3 transparent sprites unless you are running it on an abacus :)
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Mon Feb 16, 2015 12:43 pm

Your idea of creating three transparent buttons is perfect for this purpose, you could also make them opaque but set them invisible on their properties.
Performance shouldn't be affected by only three objects . I'm making a game where there are 65 buttons in only one layout and performance is a little bit affected :)
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Mon Feb 16, 2015 1:21 pm

My game is already taking 70% CPU power, I'm trying to cut down on everything so I thought it might've helped a bit, thanks for your responses.
ImageImage
B
25
S
6
G
8
Posts: 774
Reputation: 6,650

Post » Mon Feb 16, 2015 1:50 pm

70%??
On mobile I hope!
How much big is your png map?
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Mon Feb 16, 2015 3:08 pm

BouncyTrip wrote:70%??
On mobile I hope!
How much big is your png map?


Yes, on a cell and only on an old one. Good is, it still manages to do over 50fps. That png is 400x400, but it has to do more with the game still running in the background while the png is displayed than with the size.
ImageImage
B
25
S
6
G
8
Posts: 774
Reputation: 6,650

Post » Mon Feb 16, 2015 4:45 pm

Oh, it seems that everything is ok, if you add the buttons and test the performance, let us know :)
B
11
S
3
G
1
Posts: 91
Reputation: 997


Return to How do I....?

Who is online

Users browsing this forum: ColombageEnPLS, FabianB and 11 guests