Helion-Engine / Helion

A modern fast paced Doom FPS engine
GNU General Public License v3.0
86 stars 9 forks source link

Improved crosshair #565

Closed piXelicidio closed 4 months ago

piXelicidio commented 4 months ago

First I want to congratulate you for the awesome project, runs great, nice features and is in C# (as I was looking for).

I wish to have a less "intrusive" crosshair that doesn't obstruct the pixels right in the center of the screen.

I felt brave enough to sniff in the code :) and found the DrawCrosshair method, where I modified it to draw four smaller segments at the ends of the cross. Also set alpha to 0.5f.

Maybe you like this better, or could be optional somehow:

       var lengthFraction = totalCrosshairLength / 4;
        hud.FillBox((horizontal.X, horizontal.Y, horizontal.X + lengthFraction, horizontal.Y + HalfWidth), color, alpha: 0.5f);
        hud.FillBox((horizontal.X + totalCrosshairLength - lengthFraction, horizontal.Y, horizontal.X + totalCrosshairLength, horizontal.Y + HalfWidth), color, alpha: 0.5f);
        hud.FillBox((vertical.X, vertical.Y, vertical.X + HalfWidth, vertical.Y + lengthFraction), color, alpha: 0.5f);        
        hud.FillBox((vertical.X, vertical.Y + totalCrosshairLength - lengthFraction, vertical.X + HalfWidth, vertical.Y + totalCrosshairLength), color, alpha: 0.5f);

image image

nstlaurent commented 4 months ago

Thanks! I'm glad you felt brave enough to try this. I do like that crosshair better. I can add it as an option along with transparency and scaling.

nstlaurent commented 4 months ago

This has been implemented with configurable types, colors, and transparency in the options.