Jump to content

Zoom Control


Camaro

Recommended Posts

Simple class to help change the zoom

  Reveal hidden contents

Usage

  Reveal hidden contents

Extreme usage

  Reveal hidden contents

 

Edited by Camaro
  • Like 6
  • Heart 2
Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...
  • 1 month later...

Another way to do it is with scroll wheel up or down, provided the mouse is onscreen:

 

		if (zScale > 500) {
            ctx.log("Z scale > 500. Zooming out. 181 is max zoom out. 1448 is max zoom in). ");
            if (ctx.getMouse().isOnScreen()) {
              ctx.getMouse().scrollDown();
              sleep(rand(50,150));
              ctx.getMouse().scrollDown();
              sleep(rand(50,150));
              ctx.log("Former Z scale = " + zScale + ". New Z scale = " + thisCamera.getScaleZ());
			}
        } else if (zScale < 300) {
            ctx.log("Z scale < 300. Zooming in. 181 is max zoom out. 1448 is max zoom in). ");
            if (ctx.getMouse().isOnScreen()) {
              ctx.getMouse().scrollUp();
              sleep(rand(50,150));
              ctx.getMouse().scrollUp();
              sleep(rand(50,150));
              ctx.log("Former Z scale = " + zScale + ". New Z scale = " + thisCamera.getScaleZ());
			}
        } else {
            ctx.log("Z scale = " + zScale);
        }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...