How could I clip graphics drawn from within a HUD actor?

Is there a way to clip graphics drawn from within a HUD actor? My use case is that I need to draw a minimap in the corner of the HUD, and it would be easier to use a clipping rectangle than to do the math to clip my primitives manually.

P.S. I am trying to do as much as possible in Blueprint.

All of this can be achieved by using the UV pins on the DrawTexture node (assuming your minimap is a rectangle/square on the screen). UVs are basically texture coordinates for the corners of your minimap. You can even rotate the minimap this way. What you need to do is to prepare a texture of the full map. Then you need to calculate the position of the player and the location of the corners in the minimap.

Let’s say you have a 12800x12800 meters level you fully printed on some texture and imported in Unreal. Also assume that your minimap will show a 256x256 meters area around you.

What you’d have to do would be to get your character’s location (e.g. [x,y] = [6400,3200]) get the relative position of its minimap area in the unit square, i.e. between 0 and 1 (e.g. x1 = (6400-256)/12800, y1 = (3200-256)/12800, x2 = (6400+256)/12800, y2=(3200+256)/12800). Then use these as your UV pin values.

I’ve since solved this by manually clipping my rectangles (the world map is generated procedurally, so I can’t pre-render the texture.)

I was really hoping for an engine feature like a clipping rectangle, as this would have further utility in other screen-based widgets. I assume UMG will support this use case in some fashion, but I haven’t really messed with it yet.