MaterialFoundry / LockView

Foundry VTT module: Locks the view for the purpose of using Foundry on a digital playmat, such as a horizontally mounted TV. Scales the scene so the gridsize is always displayed corresponding to a real-world size, and can block zooming and panning
15 stars 7 forks source link

Allow control of viewbox rotation #91

Closed Dylancyclone closed 1 year ago

Dylancyclone commented 1 year ago

Adds a dropdown menu to the "Set View" dialog that rotates the entire canvas of the controlled user in 90 degree intervals. This is especially useful when using LockView with a digital playmat so that a scene can be used without rotating the screen at the OS level or rotating the battlemap in an image editor and recreating the scene in foundry. image image My use case was I had a collection of scenes made for a online campaign where some scenes were wide and others were very tall. This is totally fine digitally, but it makes it impossible to display each of the scenes in their entirety on a horizontal TV without changing the orientation of the display back and forth (Or manually going through and recreating each scene with a rotated background image). This way, the DM can simply load the scene, and rotate the entire canvas if necessary

This is my first time working with a Foundry Module, so please let me know if I've done anything incorrectly, or if there is a better way to accomplish this Thank you for creating this module!

CDeenen commented 1 year ago

Thanks for the PR, note that I have not tested it yet, so everything below is on the assumption that it works fine.

This is quite an interesting feature, not something I thought of before, but I can see that it can be useful in some situations. But I wonder if using the 'Set View' dialog is the best approach. Wouldn't it make more sense to put it in the scene configuration? Unless I misunderstand the purpose of this feature, I don't think it is necessary to be able to rotate the view on the fly, instead the DM configures it before the game and the rotation is automatically applied when the scene is loaded. If you do want on the fly rotation, another option would be to (also) add control buttons to rotate the canvas 90 degrees.

Dylancyclone commented 1 year ago

That is a very good point. Every use I've had for it can be solved by configuring it in the scene settings. I can add that in tomorrow.

Do you think it would be useful to have the option in both (or all three) locations, or just within the scene configuration?

CDeenen commented 1 year ago

I don't know how useful it would be to have the on-the-fly options, but since you've already added it you can just leave it in. I don't think anyone will be bothered by it. Maybe there is a usecase for it. I don't see a need to add the control buttons, it can always be added if someone does want it. However, if you do want to do it I'd be fine with it, as long as the buttons are optional. This'd mean adding a module setting so the buttons are only displayed if this setting is enabled (have it disabled by default).

Dylancyclone commented 1 year ago

Just pushed up a commit that adds the option in the scene configuration. image image It should work with any combination of configurations, including options like automatically fitting horizontally or vertically

Let me know how it looks :D

CDeenen commented 1 year ago

Great, I'll have a look when I have the time.