# Magnifying part of Transform

**URL:** <https://forum.castle-engine.io/t/magnifying-part-of-transform/943>\
**Category:** Uncategorized\
**Created:** [October 17, 2023, 3:01pm UTC](https://forum.castle-engine.io/t/magnifying-part-of-transform/943 "2023-10-17T15:01:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carring](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/carring/32/1950_2.png) [@Carring](https://forum.castle-engine.io/u/Carring)\
**Post date:** [October 17, 2023, 3:01pm UTC](https://forum.castle-engine.io/t/magnifying-part-of-transform/943/1 "2023-10-17T15:01:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [October 17, 2023, 4:15pm UTC](https://forum.castle-engine.io/t/magnifying-part-of-transform/943/2 "2023-10-17T16:15:09Z")

</div>

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

 ![screenshot_2](https://forum.castle-engine.io/uploads/default/original/2X/5/5a921827bf6b22939ab8ce06ed786ab09c79c8fb.jpeg)

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](https://castle-engine.io/user_interface#_mask) ) 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 🙂
