tModLoader Merging multiple Texture2D's into 1

I am currently working on a mod that adds an extra FOV to the screen (see image), but implementing this in the Terraria framework seems pretty hard, and i might need some help.
I have looked into shaders, Terraria UI, Terraria particles and the Xna engine itself. Since shaders in HLSL feel like a pain, and i know c# well enough (i think) i went with a c# oriented solution with the Texture2D class.
The best thing i could think of performance-wise is creating 2 static Texture2Ds in the game on load, one with the blackscreen and centered circle, and one with the triangle. When the UI is updated, i rotate the triangle based on the mouseposition and merge it into the first texture so i can call a single draw.

I am able to generate a black screen or circle over the normal game using the UserInterfaces, Texture2D, and calling the Main.spritebatch.Draw method twice, but both doesn't go together, since the circle doesn't overwrite the first draw of the blackscreen.
My final question: Is there a way to make a helper to combine/merge multiple Texture2Ds together assuming you already have the position and rotation you want?
ExampleFOV.png

If i need to show some of the code or i didn't explained my problem/ideas well, let me know.
A place where i can ask/look further would be appreciated too, or a different method in general if needed. Any help helps.
Thanks already for all the help and support!
 
Last edited:
Back
Top Bottom