0 Favourites

Making a menu, Mouse over

This forum is currently in read-only mode.
  • 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.

  • 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

  • wait

    there's an easier way

    make a mouse and keyboard object

    then two events

    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]
    
    [url=http://willhostforfood.com/access.php?fileid=63355]click here for cap[/url]
  • I'd prefer animations simply to ease clutter; if you have more than one definitely use families as BROO said.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • wait

    there's an easier way

    make a mouse and keyboard object

    then two events

    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]
    
    [url=http://willhostforfood.com/access.php?fileid=63355]click here for cap[/url]
    

    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

  • I tried this before but can't get it to work... what am I doing wrong?

    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!

  • 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

    http://willhostforfood.com/?Action=down ... leid=63403

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)