How to get mouse position with the layout object

This forum is currently in read-only mode.
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • so i'm trying to make a menu in game using the layout object, which is what it seems like it was made for. but the layout object window gets its mouse position from the mouses position relative to the x/y of that layout object layout. not the actual mouse position. making using the mouse in the layout object worthless unless its exactly lined up with the corner of the screen.

    is there any way to get the mouse to work as it appears to be on screen?


    here you got an example how to make a menu.

  • hmmmmmm. bit of miss communication I suppose. I understand how to change layouts.

    my question is with the layout object. I'm trying to use it to make a rts like build menu.

    however the mouse in the layout object is not were the actual mouse is at.

    thanks for trying to help though. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I find the best way to make a hud is to use inheritance layers. Its a little known feature but its pretty awesome. basically you can set a layer to inherit from a layout in its properties. just make sure to include that layouts event sheet! I dont have time to make a proper example but a search on the forums should bring one up!

  • Get the mouse position from the System object.



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can do it with global variables to transfer the coordinates.


    LayoutMouseX = MouseX - Layout.Left

    LayoutMouseY = MouseY - Layout.Top

    Then just use those global variables for mouse coordinates in the Layout in the Layout object.

    Keep in mind that you'll have to event accordingly. For instance you will no be able to use "on object clicked". Instead you'll have to use "on click" and "object overlaps point".

  • hey thanks R0J0hound exactly what i was looking for. you're awesome.

    Aeal5566 I've never worked with inheritance layers before. sound like something worth experimenting with.

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