License from €75 Log in
DE EN FR ES IT CZ

Sliding interface

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    Hi all,
    I have implemented A slinding interface (inventory) using this code:
    I have a button with:
    "On Cursor enters button area":
    local pos = Interfaces["Main"].InterfaceOffset
    if pos.y == -95 then 
     Interfaces["Main"]:to(1000, {InterfaceOffset = {x=pos.x,y=0}}, easeQuintIn)
    end

    And "On Cursor leaves button area":
    local pos = Interfaces["Main"].InterfaceOffset
    if pos.y == 0 then 
     Interfaces["Main"]:to(1000, {InterfaceOffset = {x=pos.x, y=-95}}, easeQuintIn)
    end

    My problem is: 
    In the inventory I have some more  buttons (placeholder for items) whan the cursor is on one of them the "Cursor leaves button area" event is triggered and the interface is start to slideing.

    How can I solved it?

    Thought for solution: 
    In "Cursor enters/leaves button area", test if the cursor is over one of the interface buttons, if not continue. but what is the code for thet?

    Thank you!
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 9 years ago
    Add the on leave stuff into the "action on leaving" section under "properties" for the interface. You will need to specify the interface area, if you haven't already done so via the "create and edit interface area" button above the interface preview viewport & drawing around the interface.

    You might want to check out this sliding interface template I created the other week - it's for vs 5.x.
  4. · 9 years ago
    Simple and easy.
    "action on leaving" section under "properties" for the interface
    Thank you!
  5. · 9 years ago
    Did you check out the template I linked? It uses a bit of math to always make sure the interface speed remains constant even if you start or end the slide before it is done. I would recommend it if you are doing a mouse over/out type sliding interface.

    The absolute positioning method you have used works great for when you want to open & close an interface with the mouse wheel or an interface button or keyboard button.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?