I'm trying to recreate those binoculars you see by the seaside which you can put money in and view, but it could also be some regular binoculars.This is done quite well in the game Barrow Hill in the cabin.
I've come up with a script below that works ok but with a few problems. "bins" is a png overlay 2400*1800 to make it look like you're looking through some binoculars (2 black circle fringes, see image below) and view is the scene behind that which you can look around by moving the mouse and is 3264*2448. My game resolution is 1024*768, the bins image is bigger because it goes offscreen at the edges, I would tile it like in the torchlight script but its a bit beyond me at this point.
Mainly the movement is too fast and also it doesn't seem to stop moving even after I stop moving my mouse. The WaitFor (bins); bit is an attempt to make the view image and the binoculars to move together so it looks realistic, it hasnt worked that well though and the they will still move without the view a bit. Adding Sleep(20) helps a bit with that but it makes everything very jerky.
I used skip instead of scroll because i didnt like that you have to wait for it to move to a point even though your mouse had already moved somewhere else and I've have problems controlling scroll speed in other scenes, scrollpixel works but is jerky,scroll speed simply doesnt work for me, i can make it slower but anything less than 10 doesnt make any difference, is this a bug because I think it worked at one point?
Is there anyway to reduce the mouse sensitivity/speed? I think that would help if I could.
var bins = Scene.GetNode("bins");
var view = Scene.GetNode("view");
Game.MainObject=null;
Scene.AutoScroll=true;
actor.Active = false;
Scene.SkipTo(1632,1224); //half resolution of the view image
bins.SkipTo(Scene.MouseX-1200,Scene.MouseY-900);
Sleep(1800); //to stop movement before the scene has initialised
while(true)
{
Scene.SkipTo (Scene.MouseX,Scene.MouseY);
bins.SkipTo(Scene.MouseX-1200,Scene.MouseY-900);
//the binoculars follow minus half their resolutiion to keep them centered
WaitFor (bins); //wait so the bins and view move together
WaitFor (Scene.SkipTo);
}