-- * instructions * --
script type must be set to "definition"!
the interface you want to slide out must have the same name as the interface mentioned in the script; in my case I named the interface "inventory" which you will see I used getObject to call the interface. if you call your interface something else then remember you need to change "inventory" in the script to whatever name you used.
secondly the condition name must also reflect the one inside the script; in my case I called the condition "slide?" so just rename the one found in the script to whatever you use.
you can speed up or slow down the speed that the interface slides in or out by increasing / decreasing the "+ 2" / "- 2" values found in the script. * plus/minus 2 is quite a nice smooth speed. I do not recommend going any higher than 10 at the most!
the min_offset should be set to the default absolute position of your interface you wish to slide out & max_offset should be changed to whatever you need.
*quick note if you want to center your interface x or y to the screen then you need to ... º x position for center equals: screen default resolution width - interface width / 2 (example: 1920 - 400 / 2 = 760) º y position for center equals: screen default resolution height - interface height / 2 (example: 1080 - 600 / 2 = 240)
hover mouse over the interface to slide out. move mouse away from interface to slide back to default position.
press "Q" to exit the demo!
script: pastebin project file: dropboxP.S: I may modify this in the future to also allow slide in/out of interface using mouse_wheel - like in Deponia - depending on if x condition = true or false ... not everyone has mouse_wheel; some laptops & mini mice etc ... I myself am currently using a wacom tablet as my mouse seeing as the touchpad on my paptop has stopped working!
changed the increment value from 5 to 2 as it slides out much smoother ... made the "less than or equal to" / "more than or equal to" values to "less than" / "more than" values to make the script a bit less taxing on cpu.
added a few more lines of annotation & replaced the project file in my dropbox with the new one
I will be adding mouse wheel support later the day.
the bug is listed inside the notes section of the wiki & also commented into the script itself.
startObjectTween(Interfaces["int_inventory"], VInterfaceOffset, Interfaces["int_inventory"].InterfaceOffset, {x = 0, y = 0}, 1000, easeBounceOut) -- I'm sliding "int_inventory" interface to x0 & y0 over 1000ms (1s) with bounce easing on destination.