Thanks for trying it out! It has been officially accepted into the engine and should show up once the new examples browser is out, I think.
As far as the resolution variable: I tried playing with that, but unfortunately SceneWindowWidth() and ScreenWidth() work differently depending on the platform (Desktop/browser/etc), so manually setting the resolution, until we can get expressions to actually get the Resolution settings from preferences, seems like the most agnostic option.
(Also, if someone is using my GUI Layer example, they’re going to want the fixed resolution numbers anyway since the “real resolution” is different than the “perceived resolution” once zoomed in.)
As far as the clamp math: Yes, I tried to give as much detail as I can, because I had to piece through math I could find from 4 other engine examples (Defold, Construct, Godot, and Unity) because GD5 does camera movement slightly different (Center vs Origin) and how we interact with objects/etc are slightly different.
That said, I really wanted to avoid as many objects as I could. For example, with how Lerp works, there’s a slight “gradual” last step of movement between rooms that I can’t fully eliminate. You could eliminate this entirely with a “camera” object that you tween to the clamped position, but that’s another object to deal with, which could be even more confusing for users.
For your stated goal, clamp with similar math could definitely accomplish what you’re thinking about, and help avoid issues, although you’d probably be gauging based off zoom rather than position, wouldn’t it? Either way, the math will likely be needed.