Lock View is a module that gives the GM (or a designated player) control over the zoom and pan capabilities of users, such as locking the zoom or pan, moving the canvas, or setting the view to a specified setting.
The module was originally made as a companion app for my
Material Plane module, and to make play using a digital playmat,
such as a horizontally mounted TV, easier.
Over time, however, the module's features have expanded greatly, including many functions that can be useful for digital play.
The module has 6 main functions:
- Autoscaling: Scales the scene in various ways (horizontal fit, vertical fit, automatic fit, or scaled to a physical gridsize)
- Zoom lock: Locks the zooming of the scene to prevent the user from (accidentally) messing up the autoscale
- Pan lock: Locks the panning of the scene. If you use physical minis you don't want to accidentally pan
- Bounding box: Limit zoom and pan to stay within a bounding box
- Force initial view: After loading a new scene, the view is forced to the initial view (as set in the scene configuration menu), regardless of the position of tokens
- Viewbox: Allows the GM to see what's shown on users screens, and allows the GM to control the pan and zoom of those users
'Autoscaling', 'Zoom Lock', 'Pan Lock', 'Bounding Box' and 'Force Initial View' can be set for each scene independently.
'Zoom Lock', 'Pan Lock' and 'Bounding Box' can be enabled and disabled at any time using control buttons.
These functions can be applied to selected connected users (must be set in the GM's module settings).
Note: When 'Zoom Lock' or 'Pan Lock' are enabled, this module disables all zooming and/or panning functionality, regardless of who or what is requesting that zoom or pan. This means that, for example, modules that try to pan or zoom won't work.
Physical Play
When using a horizontally mounted screen, for the purpose of playing with physical minis, you should do the following:
GM's client, module settings:
-In the User Configuration screen, enable the module and viewbox for the user that is connected to the TV
GM's client, scene configuration menu (for each scene):
-Set 'Autoscale' to 'Physical Gridsize', which forces the TV's client to a specific zoom, ensuring the grid is always the same physical size
-Enable 'Lock Pan' and 'Lock Zoom', which prevents the TV's client from accidentally zooming or panning
TV's client, module settings:
-Set 'Gridsize' to the desired physical size of the grid. Usually 25 mm or 1 inch. Only fill in the number, not the units
-Set 'Screen Width' to the physical width of your screen (the actual screen, without bezel). Must be in the same units as 'Gridsize'
Refer to the 'Settings and Controls' section below to see how the GM can manipulate the view of the TV's client.
Digital Play
The module can also be used when playing digitally (every user has their own computer). When doing so, you can ignore the following settings:
-'Gridsize' and 'Screen Width' in the module settings
-'Physical Gridsize' in the scene configuration menu (Autoscale option) and in the 'Set View' dialog box
GM's client, module settings:
In the User Configuration screen, enable the module and viewbox for each user whose view you want to control/view.
GM's client, scene configuration menu (for each scene):
Set up the settings as desired (see below)
Refer to the 'Settings and Controls' section below to see how the GM can manipulate the view of the user clients.
Landing Page/Splashscreen
You can use Lock View to create a static landing page or splashscreen.
GM's client, module settings:
In the User Configuration screen, enable the module and viewbox for each user whose view you want to control/view.
In the Scene Configuration:
-Set 'Autoscale' to 'Automatic Fit'. You can choose either the inside (crops a part of the canvas to make it full screen) or outside option (shows the whole canvas,
but can show some padding)
-Enable 'Lock Pan' and 'Lock Zoom'
-Make sure 'Bounding Box' is disabled
-Optionally enable 'Exclude Sidebar' and 'Blacken Sidebar' to make sure the sidebar isn't blocking part of the scene
-Set the scene background color to black ('#000000')
Module Settings

In the module settings, as a GM you will find 3 buttons at the top:
- Help: Opens this help screen
- User Configuration: Opens the user configuration screen, where you can configure how the module acts for specific players (see 'User Configuration' section below)
- Scene Configurator: Opens the scene configurator, where you can configure Lock View for each scene (see 'Scene Configurator' section below)
Below that, as a GM you will see the following setting:
- Hide Control Button - Enabling this will hide the control button (on the left side of the screen). This can be useful if this control button is never used, and will prevent it from cluttering the screen.
All connected users will also see two more settings which are only relevant if 'Autoscaling' is set to 'Physical Gridsize' (see 'Scene Settings' section below), as these settings allow the module to calculate the correct grid scale.
These settings are:
- Screen Width - Fill in the physical screen width in mm or inch of the TV
- Gridsize - Fill in the desired gridsize in mm or inch (must be the same unit as 'Screen Width'). This is usually 25 mm or 1 inch
User Configuration

This screen can be accessed from the module settings. Here you can configure how the module acts for each user or group of users. Under 'User Settings' you can configure each user individually, and under 'Role Overrides' you can configure the settings based on user roles.
The following options are available:
- Enable: Enables all features for the user (locks, autoscaling, etc), except for the viewbox
- Viewbox: Enables the viewbox for the user, and allows the view to be controlled
- Control: Allows the user to control enabled users (always enabled for the GM). This will give access to the control buttons (to enable/disable locks, view/edit viewboxes, etc)
Below the users you'll find the 'Default' user settings. Whenever a new user is created these settings will be applied.
Scene Configurator

This screen can be accessed from the module settings or from each scene's configuration.
The Scene Configurator can be used to quickly modify the settings for each scene. The settings are identical to the ones configurable in the 'Scene Settings' (see below).
Each row in the table represents a scene with its configured settings and can be changed as desired.
The bottom row is the 'Default' configuration. New scenes will use these settings.
At the right of each row are 3 buttons:
- Copy: Copy this configuration
- Paste: Paste the copied configuration to this scene
- Reset: Reset this scene to the default configuration
Scene Settings
In the scene configuration screen, you'll find a new Lock View section with the following settings:
- Lock Pan: Initial 'Pan Lock' setting
- Lock Zoom: Initial 'Zoom Lock' setting
- Bounding box: Initial 'Bounding Box' settings
- Autoscale: Automatically scales the screen
- Rotation: Rotate the canvas
- Exclude Sidebar: Exclude the area behind the sidebar from the bounding box or autoscaling. This can be enabled because the sidebar can obscure parts of the map
- Blacken Sidebar: Blackens the background of the sidebar to prevent users from seeing outsie of the bounding box or canvas (only works if 'Exclude Sidebar' is enabled)
- Collapse Sidebar on Scene Load: Collapses the sidebar when the scene is loaded, mainly useful in combination with 'Hide UI on Sidebar Collapse'
- Hide UI Elements on Sidebar Collapse: Hides selected UI elements (such as the macro hotbar, scene navigation, etc) when the sidebar is lockView_collapsed, great for landing pages or
splash screens. You can configure which elements to hide by pressing the 'cog' button next to the checkbox. By default all elements except for the sidebar are enabled.
The 'Ctrl+u' hotkey can hide/unhide the elements in case they need to be accessed
- Force Initial View: Forces the view to the 'Initial View Position' after loading the scene. Only works if 'Autoscale' is set to 'Off' or 'Physical Gridsize'
- Configure Initial View Position button: The button is located to the right of the 'Force Initial View' checkbox. Pressing it opens the 'Configure Initial View Position dialog screen (see below)
- Scene Configurator: Opens the scene configurator, where you can configure Lock View for each scene (see 'Scene Configurator' section above)
Autoscale can be set to the following options:
- Off: Autoscale disabled
- Horizontal Fit: Automatically scales the scene to fit the browser window. Horizontal fit, so it may cut off vertical parts of the scene
- Vertical Fit: Automatically scales the scene to fit the browser window. Vertical fit, so it may cut off horizontal parts of the scene
- Automatic Fit (inside): Automatically chooses horizontal or vertical fit so no non-image background will ever be seen
- Automatic Fit (outside): Automatically chooses horizontal or vertical fit so the full background can be seen, but can show the padding (area outside of the background image)
- Physical Gridsize: Scales the scene so the on-screen gridsize corresponds with a real world value (for example 25mm or 1"). The gridsize is determined by setting the 'Screen Width' and 'Gridsize' in the module settings. These settings are local, which means that they can be different for each connected client
Note 1: The 'Pan Lock', 'Zoom Lock' and 'Bounding Box' settings determine the initial settings. These are applied when a scene is loaded, or after closing the scene configuration screen. After that, you can enable or disable them by pressing the control buttons (see below).
Note 2: 'Horizontal Fit', 'Vertical Fit', 'Automatic Fit' and 'Physical Gridsize' are applied when a scene is loaded, or after closing the scene configuration screen. After that, the user can zoom and pan around (if Zoom Lock or Pan Lock are disabled)
Configure Initial View Position

By pressing the 'Configure Initial View Position' button to the right of the 'Force Initial View' checkbox, a dialog box opens and a red box is drawn on the canvas.
This red box corresponds with the 'Initial View Position' as set in the 'Ambience and Atmosphere' section of the 'Scene Configuration Screen'.
Pressing the 'move' icon at the top left of the red box moves the box around while pressing the 'scale' icon at the right bottom scales the box.
In the dialog box, you'll find the following values and buttons:
- Old initial view position - The old initial view position as it is currently set in the scene configuration
- New initial view position - The new initial view position as displayed by the red box. These values are user editable
- Size in grid spaces - The size of the view expressed in grid spaces. These values are user editable
- Set to physical gridsize - Scales the 'new initial view position' to correspond with the physical gridsize as set in the module settings
- Set to player view - By selecting the name of a player that's currently connected, you can set the initial view position to the view of that player by pressing 'Capture View'
- Snap to grid - Snaps the 'new initial view poisition' to the grid. With the dropdown menu you can select which corner of the box should be snapped to the grid
Note: The displayed red box has the aspect ratio of the your (the GM's) screen. This does not necessary correspond to the aspect ratio of your players' view. The center of the red box
will correspond with the center of the players' view (it ignores the sidebar).
By pressing the 'Cancel', 'Save', or 'Close' button, you'll return to the scene configuration. Only when the 'Save' button is pressed the initial view position on the scene configuration will be updated.
Don't forget to save the scene configuration to have the new settings take effect.
Bounding Box

The bounding box function limits how much a user can zoom or pan. It needs to be enabled, either in the scene configuration screen, or using control buttons. This function ensures that they always stay within a defined box.
To enable the bounding box function on a scene load, you can enable the function in the scene configuration screen. The function can also be enabled on the fly by pressing the control button.
By default this box is the canvas size (size of your background image), so users will not see the background color and padding.
It is also possible to define a bounding box by drawing a rectangle (control buttons => drawing tools => draw rectangle). After drawing the rectangle, you can edit it (double clicking the rectangle) to set the rectangle as a bounding box. This can be done in the Lock View tab, where you have the following options:
- Disabled: The rectangle is not used as a bounding box
- Owned Tokens: Use the rectangle as bounding box if a token that's owned by the user is within the rectangle. You can set multiple rectangles to 'Owned Tokens'. Moving a token from one 'Owned Tokens' rectangle to another forces the view to the new rectangle. If you have multiple owned tokens in different 'Owned Tokens' rectangles, the bounding box will extend to fit all of these rectangles
- Always: The rectangle is always used as bounding box, also if no tokens are within the rectangle. This overrides all other rectangles. Only one rectangle should be set to 'Always'. If more rectangles are set to 'Always', only one is chosen
Control Buttons

On the left of the screen, there are new control buttons for the GM that display and toggle the current setting on the scene.
From the top to the bottom:
- Set View - Creates a dialog box with options to set the view, see below
- Pan Lock - Shows/switches the current state of 'Pan Lock'. If on, panning is disabled
- Zoom Lock - Shows/switches the current state of 'Zoom Lock'. If on, zooming is disabled
- Bounding Box - Shows/switches the current state of 'Bounding Box'. If on, zoom and pan are limited to the bounding box
- Viewbox - Draws a square on the canvas that shows what enabled users can see. The color of the square corresponds with the 'Player Color'
- Edit Viewbox - Allows the GM to edit a viewbox, and the users' view. Right-click dragging drags a viewbox and pans the viewbox's user sceen, the scrollwheel increases or decreases the size of the viewbox and zooms the screen the user in or out. Additionally, two icons appear next to each viewbox which can be used to zoom or pan the view of the user.
Set View Dialog
After clicking the 'Set View' control button, a dialog box appears that gives multiple options to control the view of users. There's 3 dropdown menu's, and 3 number boxes
Top dropdown menu (X & Y movement)
- Reset to initial view: Resets the view to the initial view position, as set in the scene configuration screen
- Horizontal fit: Scale and move the view so the scene fits horizontally
- Vertical fit: Scale and move the view so the scene fits vertically
- Automatic Fit (inside): Automatically chooses horizontal or vertical fit so no non-image background will ever be seen
- Automatic Fit (outside): Automatically chooses horizontal or vertical fit so the full background can be seen, but can show the padding (area outside of the background image)
- Move grid spaces: Moves the view in grid-units, relative to the current view. So setting X to 1 will move the view 1 gridspace to the right
- Move to coordinates: Moves the view to the absolute coordinates as set in the number boxes
Middle dropdown menu (Zooming)
- Ignore scale: No zooming will occur
- Set scale: Zooms to the scale size set in the 'Scale' box
- Reset scale: Resets the zoom to the initial zoom factor, as set in the scene configuration screen
- Physical gridsize: Automatically scales the gridsize to make it correspond to a physical gridsize (in mm or inch), as set in the module settings
Bottom dropdown menu (Rotation)
Rotate the canvas as set in the dropdown menu.
Viewbox
The viewbox is a function that allows the GM so see what users can see.
If enabled (enable for the user in the User Configuration screen in the module settings, and enable the 'Viewbox' control button),
a rectangle is drawn that corresponds with the view of the user. The color of the rectangle is the user color, and above the rectangle you can find the user name.
It is possible for the GM to control the view of the users by enabling the 'Edit Viewbox' control button.
If enabled, the GM can either control the view of all enabled users: pan by left-click dragging and zoom by using the scroll wheel.
Or control the view of individual users by dragging the icons next to each viewbox that appear when the 'Edit Viewbox' control button is pressed: Drag the upper-left icon to pan, drag the lower-right icon to zoom.
If you have any suggestions or bugs to report, feel free to contact me on Discord (Cris#6864), or send me an email: cdeenen@outlook.com.
Author: Cristian Deenen (Cris#6864 on Discord)
If you enjoy using my modules, please consider supporting me on
Patreon.