Making a menu, Mouse over

For questions about using Classic.

Post » Sun Apr 19, 2009 2:09 pm

Hello everybody,

I have question about making a menu in construct.
I want it to be the starting screen, with 3 buttons.

I have two .PNG graphics for each button.
How do i get a mouse over effect?

Thank you in advance.
B
2
G
4
Posts: 13
Reputation: 1,076

Post » Sun Apr 19, 2009 2:22 pm

You create sprites. Each of them is different sprite.
You give every of these sprites two animations:
-> Default (that is made at sprite creation)
-> MouseIsOver (in animator editor you press "Add New Animation" and you rename new animation name)
In animation "Default" go into edition of frame (double-click on frame) and then load graphics from PNG file - that's second button from top toolbox in picture editor. Load your graphics of Mouse-NOT-Over.
Do the same with frame in "MouseIsOver", but load Mouse-Over.

When you made one sprite with one button, make rest three the same way.

Now each of those sprites give family - on the left properties bar you select -> "Groups -> Families -> Add New". All sprites must belong to the same family.

Also create "Mouse & Keyboard" object in layout editor.

Now in event sheet editor add event:
Conditions: MouseKeyb -> Mouse Is Over Object? -> Select that Family
Actions: Family -> Set Animation -> "MouseIsOver"

Add new Event (below this one)
Conditions: System -> Else (now you should see that those events are connected, meaning that "else" is related to the event above)
Actions: Family -> Set Animation -> "Default"

I'll try that in a minute.

Edit: works ;)
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Sun Apr 19, 2009 5:48 pm

wait
there's an easier way

make a mouse and keyboard object
then two events

[code:3q634y47]system - always
offsprite.set visible: visible
onsprite.set visible: invisible

mouse/keyboard - mouse over object - offsprite
offsprite.set visible: invisible
onsprite.set visible: visible
[/code:3q634y47]

click here for cap
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Apr 19, 2009 6:04 pm

I'd prefer animations simply to ease clutter; if you have more than one definitely use families as BROO said.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Apr 19, 2009 7:56 pm

[quote="lucid":l2ubcu1a]wait
there's an easier way

make a mouse and keyboard object
then two events

[code:l2ubcu1a]system - always
offsprite.set visible: visible
onsprite.set visible: invisible

mouse/keyboard - mouse over object - offsprite
offsprite.set visible: invisible
onsprite.set visible: visible
[/code:l2ubcu1a]

click here for cap[/quote:l2ubcu1a]

I tried this before but can't get it to work... what am I doing wrong?
Here is my .cap http://willhostforfood.com/?Action=down ... leid=63389
B
2
G
4
Posts: 13
Reputation: 1,076

Post » Sun Apr 19, 2009 8:35 pm

[quote="Slaughtersoft":26dtfkd8]

I tried this before but can't get it to work... what am I doing wrong?
[/quote:26dtfkd8]
I have no idea why it was doing that, unless you were trying the animation method first...it really makes no sense to me

anyway, start from scratch and it should work, I think that was some random nonsense,
also, if you use the "mouse is over" with "system-else" instead of always
it makes more sense, and it's probably more efficient then the other way

like this
click me

you can make all the mouseovers work with one event, but then you need use the object pairer and families, if you have questions on how to do that, let me know
if you have alot of mouseovers you want to do, broos method will be much cleaner as rich said
it just seemed kinda complicated if you're just getting into construct
which I assumed you were, since I haven't seen your avatar around

welcome! :mrgreen:
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Apr 19, 2009 9:01 pm

Thank you all so much!

I've figured out my problem. An animation frame from one of the buttons, caused the problem.
( should not have another frame...)

Also I've fiddled with the family thing, and it worked out like i intended!
Thank you all for the clear explanation.

And thank you for welcoming me!
Construct is a bit different to use for me ( I was using MMF 2 before )

Oh and here is my file, maybe one of you has got any handy pointers :roll:


http://willhostforfood.com/?Action=down ... leid=63403
B
2
G
4
Posts: 13
Reputation: 1,076


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests