Best method for rollover buttons

Get help using Construct 2

Post » Thu Oct 03, 2013 8:42 pm

I am new to C2 and have been trying to figure out how to create a basic rollover for buttons on my title screen. I have come up with a few options but now I am in question as to which method is best and provides the best performance or if there is yet another method in which I can try. From cruising the forums I was able to come up with the follow two methods. Any thoughts or critique on what is the preferred method and why it is preferred would be much appreciated. Thanks for the time!

Started here...



I then read something slightly different and adapted to this...



I then landed on a multi button version where I have a condition for each of the button rollovers but am adjusting the off state of the mouse and cursor with a single rule. I am not sure if this is efficient?



Again, thanks for the time and any thoughts are appreciated.ShagenBake2013-10-04 18:45:15
B
8
S
3
G
1
Posts: 18
Reputation: 1,209

Post » Thu Oct 03, 2013 11:54 pm

The first one looks fine...Instead of the Else you can use the same event twice and invert it if you want. Mouse Cursor is over btnStart > Right click > Invert. This will then set the anim to default when the mouse cursor is not over a btnStart object but the Else should suffice anyway..
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Fri Oct 04, 2013 12:08 am

I've been working on a solution from scratch after my current game got kinda messy with UI stuff.

Here's my current WIP solution: https://www.dropbox.com/s/fwcf2n9iyqt2hn7/buttons.capx

It's optimised to use minimum texture memory, work across touch/mouse and support toggled states.

Hope that helps.
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,940

Post » Fri Oct 04, 2013 12:17 am

You may want to use something like imgur or similar to host images, as the host site is not allowing remote linking/embedding of the pictures.

Here's what I'd do, to create a windows style button :

Image
B
27
S
9
G
5
Posts: 488
Reputation: 11,948

Post » Fri Oct 04, 2013 6:50 pm

Appreciate all the responses and will look them over closely! Thanks JohnnySix for the heads up on the images. I have jumped on to imgur and am linking the images from there. I thought they were public via evernote but turns out I was either doing something wrong or the exact image URL is still https where as the public link that you can share may not be.

Thanks again and appreciate such a great response to my first post on the forum! Loving the C2 community thus far and am learning a lot.
B
8
S
3
G
1
Posts: 18
Reputation: 1,209

Post » Mon Jan 20, 2014 5:53 pm

I have been approaching this the same way you started but I am using families and simplified it a bit. Each time I add a new button that needs a hover state OR a mouse over state I simply add it to that family and its logic is taken care of vs doing it for each button.
B
14
S
2
Posts: 39
Reputation: 689


Return to How do I....?

Who is online

Users browsing this forum: Christmas and 44 guests