This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
I tried to show an example of this with my "Simple Maze" template but apparently V.S has issues with complicated object areas. I have yet to try using way areas/points & action areas yet & controlling character pos with mouse pos - maybe that'll be ok for a work-around!?
anyway onto the examples for this!
Firstly we'll do setCursorPos which is nice & simple & looks like this: "setCursorPos({x=co-ordinate,y=co-ordinate})"
setCursorPos({x=400,y=450})You can find the co-ordinates you need via the numbers in brackets on the top right hand corner of the scene preview screen by hovering mouse cursor over the area you want to find the co-ordinates to - see screenshot below.
hint: x = horizontal & y = vertical (for anyone who doesn't know)
right now onto get cursor position script which is also a simple one line piece of code which can also include return values of if pos = so so then do so so or do nothing.
basic example
getCursorPos()setting the cursor pos in a custom variable
local CurPos = getCursorPos()Adding it to a return value if/else statement
local CurPos = getCursorPos()if setCursorPos({x=400,y=450}) != CurPos then
setCursorPos({x=400,y=450})
else
end
this is just a quick example but you could use LUA to find the position & width/height of an object area or something & use that to calculate if the cursor is inside or outside of the object area & what to do in each instance ![]()
P.S I know the final code example isn't correct as it will most likely set the cursor pos before checking the saved cursor pos obtained in the get cursor pos statement - I will update it later on with something better!
The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Until 1 Dec 2026 all licenses are 30 % off, for example the Indie Bundle for €69.30 instead of €99. The code BLACKFRIDAY is applied automatically at checkout.
See licenses Try it for freeCheers
For example how would I type out a mouse event for mouse moves? so I can then define with other if else statements what it should do?
also how do I read the x,y positions of getCursorPos() individually?
Cheers
This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.
New threadDeponia, The Whispered World and more than 160 other games were made with Visionaire Studio. The free version covers up to 25 scenes. For more scenes there is Visionaire Studio PRO from €75, and to sell your game the Indie Bundle for €99.
Through December 1: all licenses 30% off, for example the Indie Bundle for €69.30 instead of €99. Applied automatically at checkout.