- Home /
Round radar minimap using GUI.Drawtexture: how to mask the blips so they don't render at the corners outside the circle?
http://wiki.unity3d.com/index.php?title=Radar The minimap radar scripts in this website uses GUI.Drawtexture for the blips that are used to indicate enemy location.
I am able to set up the whole ting: a circular background, a circular forground border, and blip dots.
But the blips are being rendererd within a Rect() region, not a circular one, so they gets rendererd at the "corners" of the Rect(), which are beyond the circular background.
So I'd like to ask, is there a way to mask them inside the circular region so that they don't show outside?
<3 and Thanks!
Answer by fafase · May 18, 2014 at 06:48 AM
if the distance between the center () and the enemy is greater than the radius, discard the blip.
float dx=centerPos.x-extPos.x; // how far to the side of the player is the enemy?
float dz=centerPos.z-extPos.z; // how far in front or behind the player is the enemy?
I would think those lines should be removed as they seem to do the rect thing.
After removing if the guys are outside the circle, then reduce the distance you are comparing with. The distance being the radius of your circle.
Your answer
Follow this Question
Related Questions
use of GuiTextures? 0 Answers
Problems with Minimap 1 Answer
Minimap blib icon error 1 Answer
MiniMap Border! 1 Answer