A tool allowing modders to easily add a visual preview in MCM for the position of on-screen widgets. NOT A GAMEPLAY ADDON.
THIS IS NOT A GAMEPLAY ADDON. IT DOES NOTHING ON ITS OWN. IT IS A TOOL FOR MOD DEVELOPMENT, AND IT IS PROVIDED AS-IS.
This tool allows any modder to add a preview in MCM that lets their users visualize the position of an on-screen widget based on its XY canvas coordinates. Extremely flexible and customizable, allowing you to provide your own custom images and fine-tune the behavior for your addon.
Why is this useful?
The XY coordinates of screen elements in Anomaly are canvas coordinates, not screen coordinates. In other words, the XY coordinates will always be in 1024x768, and these coordinates get translated by the game engine into the user's screen coordinates.
This can make it very difficult to get an on-screen widget or indicator positioned exactly where the user wants it, often requiring a lot of trial-and-error with picking a value, seeing how it looks in-game, then going back to MCM again and again to adjust it.
The previewer lets them see a preview of exactly where on the screen the element would appear based on the XY coordinates they set in MCM, which updates live as each change is made. They can select between four different aspect ratios (16:9, 16:10, 21:9, and 4:3) and the preview will change to simulate a screen with the chosen aspect.
Almost none of this work needs to be done by the modder. For the most part, all that is necessary other than including the main installation is to add a small amount of code and attributes to your MCM script.
This is provided as-is. Please don't ask me to explain how to use it--the code is very thoroughly documented, in the comments, a how-to demo is included and I just don't have the time to teach people how to mod.
Update history:
1.3: Fixed issues with widget position and scaling. Added optional "debug" backgrounds for the preview, which show a white background with centering guidelines instead of a screenshot. Added new args to support this mode, and comments for them. Added an example of the new mode as a toggle in the demo.
1.2: Corrected version number (shipped as 1.1 but filename was 1.0) and a misleading typo in the header documentation for the texture prefix. No functional change.
Version 1.3 fixes a few position and scaling issues with the widget preview, and adds an optional new "debug" mode where instead of screenshots, the preview background is plain white with centering guide lines. This is off by default and can be controlled through MCM, or directly in the script.
This might be a stupid question, is there a way to enable the game view in mcm ? like the basic light settings in the video options?
In case you mean the demo, when using MO2 you have to check both boxes in the installer.
This isn't game changing yet, but this is modding-changing for sure, I cant wait to see this in use, will definitely make adjusting stuff better for consumers of the addons.
I might even try to apply this to some other mods, see if I can share edits with compatibility for this without taking any credit
Bravo!