0 Favourites

Scroll Menu?

  • I'm not sure how I'd go about this, but I'd like it so when the player presses Space it brings up 3 text objects, so I'd assume I'd do something like if

    Keyboard>Space>Pressed | Text Object>Show/Visible?

    But I'd like it so the top object is highlighted and the user can scroll up/down with their mouse and then press RMB to select that object.

    For example:

    Turret (Purchase Turret)

    Barricade (Purchase Barricade)

    Back (Hide/Close menu)

    I'd also like it so when they purchase an item it replaces the mouse cursor so that when they press RMB again it places the object down in-game. I'd guess I spawn the object at where the mouse is, the only problem I'm having is changing the cursor from my custom cross-hair which disappears if I replace it.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Hey Konkor,

    You could use something like a tiled background object for the highlighting. Just make the box big enough to cover your text and set it to visible when you make your text show up.

    I am not sure if the scroll wheel is supported to be honest I havent tried it. But you could change the highlighting objects position on the screen when the mouse is overlapping each of the text boxes.

    For the mouse states, you want to have opposite conditions programmed (which you do by right clicking a condition like "is overlapping" and select invert). One for Cursor is overlapping text (and text is visible) = Use this cursor And one to check if the cursor isnt overlapping the same object = Use that cursor.

    Alternatively, if you wanted the mouse state to always be a hand for instance when the text boxes are visible, you could add an instance variable and check that instead of checking if the mouse is overlapping.

    So many different ways of doing the same thing. It's awesome.

    Hope that helps.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
118 32,902
rexrainbow's avatar
rexrainbow
Unread hot topic
31 2,813
mammothe's avatar
mammothe
Unread hot topic
55 14,328
cingee's avatar
cingee