Draw only a part of a GUI Image

I want to draw a GUI Image inside of another GUI Image.

I want to draw a square in a circle, like the red square and not like the blue square.

The square also needs to be moved, so I don’t want to make tons of images for every possible position in the circle.

Is there a simple way to do this(I don’t think DrawTexturewithTexCords would be fitting) or do I just have to build around it?

Thanks in advance

There’s no direct way to do this in the GUI class. You can hide it by using transparency in the middle and opaque around the outside and having the circle drawn last. I’ve made the outside green to demonstrate:

29820-hide.png

If the movement is not dynamic, it is possibly to modify the texture to clip the appropriate area, but that is not something you want to do every frame. And it is somewhat complicated to implement.

It can be done with a shader for world objects.