Mouse cursor over buttons didn't work?

0 favourites
  • 7 posts
From the Asset Store
Mouse cursor is something that the player controls and sees all the time, that's why it is so important to make it cool!
  • Hello there,

    I try to use C2 to do my game's title, I want to make an effect when user's mouse is over the buttons, so I make this eventsheet:

    For each buttons:("buttons" is buttons' family )

    -Mouse:Cursor is over buttons → Set buttons' animation to "on"

    -Mouse:Cursor is not over buttons → Set buttons' animation to "off"

    However, it didn't works well,

    Sometimes user's mouse is over buttons, and buttons' animation changes to "on", but sometimes buttons' animation still keeps "off"...

    I don't know why it didn't works, is there any wrong with my code?

    BTW, could anyone tell me how to upload images on my topic? I still don't know how to show you my C2 debug's condition...

  • Try "For each" loop.

    System: For each Buttons
     Mouse is over Buttons -> Buttons Set animation "On"
     Else -> Buttons Set animation "off"
    

    to insert images, upload an image, then use "img" tag:

    [img=5432]
  • I use for each loop but it sometimes still doesn't work...

    And I select images I want to upload, but it appears message "File must have .jpg, .jpeg, .png extension."

    But all of my images are .png, and size are small then 1MB...

  • And your code really looks like this?

    This should work fine. But here another option i usually use to prevent the Player from taking several items with one click when they overlap. I store the UID of the targeted object and compare it. That may look like this:

    btw - i uploaded a jpg and a png file and both worked.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I noticed that when uploading an image, file extension should be in lowercase. "Image.jpg" works, "Image.JPG" doesn't.

  • I noticed that when uploading an image, file extension should be in lowercase. "Image.jpg" works, "Image.JPG" doesn't.

    OMG, I'll try it.

  • Thanks guys, I think I finally find out what is the problem.

    It seems like my buttons' collision polygon didn't set well...

    I also add some tag to check that buttons are able to be clicked.

    Thanks^^

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