Hey,
I'm trying to do a chat interface with a camera viewport that takes up only a part of the entire screen. The rest of the screen space is used for chat boxes and other interface stuff.
The user should be able to rotate the camera around the playing area, which is displayed in the camera viewport, somewhat akin to Homeworld or WoW style controls. When the user presses the right mouse button, I want to find out if the mouse pointer is inside the viewport or not. If it is not, nothing should happen (not even if the mouse is moved into the viewport after clicking). If the mouse pointer is over the viewport and the right mouse button is clicked and held down, the camera should rotate around an arbitrary focus point (conveniently named the "character" in my project), based on mouse movement.
I'm figuring out how to do camera rotation and such by looking at other scripts, so answers need not include that (although a really simple script suggestion would of course be nice :) ), but I have no idea how to check whether the mouse pointer is inside the viewport.
Ideally, buttons occluding the camera viewport should also prevent the camera controls from becoming active if the mouse pointer is pointing at them.
I would like to post some coding examples, but what I have is not my programming (I don't fully grasp it and it is miles long), and as for the mouse check I haven't been able to write a single line yet - I simply don't know how to get started. :(
Thanks in advance!
Worked like a charm, thanks a bunch!
– anon16956261