Magnifying part of Transform

I want to magnify part/region of a Transform when the mouse (which is a scene itself with pi ture of a magnifying glass) moves over it.
The scale option of Transform scales the whole Transform but I would like to enlarge just the region of the underlying Transform that is under the mouse scene. So enlarging just the pixels of it that collide with the mouse scene I guess.
Is this possible?

Sure! Take a look at how examples/fps_game/ makes a minimap in the corner of the screen.

Run the game, see how cool it looks when minimap view actually changes when you walk.

The idea is that you can have additional viewport (another TCastleViewport instance, with FullSize=false), with a different camera, that can show a different view at your scene. If you set there Camera with small MyCamera.Orthographic.Height then it will effectively make a “zoom in”.

The viewport is rectangular at start, but you can use mask ( User Interface | Manual | Castle Game Engine ) to make it have a circular (or any other) shape. See examples/user_interface/mask. The examples/fps_game/ also uses the mask to make minimap in a circular shape.

This additional viewport could move, as it is a UI element. This is not shown by examples/fps_game/ (where the minimap doesn’t move on the screen). But it can, as shown e.g. by examples\user_interface\custom_cursor\ that shows an viewport moving following the mouse.

By combining the above techniques, I believe you can get what you need :slight_smile: