- Home /
How to draw on a minimap?
How do I draw on my minimap in a color (in the picture, yellow is marking visited areas) emitting from the player, so I know in which areas I was already? Like this:
Minimap from Ratchet & Clank: Size Matters (PSP)
So far I got:
The minimap camera is above my player and has a RenderTexture as targetTexture that I display on a RawImage component in the UI. Also I have set its cullingMask only to "Minimap" to render the objects that are on this particular layer.
Answer by Trevdevs · Feb 25, 2017 at 08:07 PM
If I understand correctly you'll want to use Graphics.DrawTexture
First store the yellow as a texture
setup Graphics.DrawTexture with the code i assume you have that allows the game to know what area they have already visited before and to draw the yellow texture over that area.
I've never used something like this so I may be entirely wrong but would be worth a shot.
Here is the scripting reference and a reference to a similar question https://docs.unity3d.com/ScriptReference/Graphics.DrawTexture.html
http://answers.unity3d.com/questions/327984/graphicsdrawtexture-to-rendertexture-not-working.html
Your answer
Follow this Question
Related Questions
RenderTexture does not render canvas image. 0 Answers
Builtin Shader UI/Unlit/Transparent Yellow Pixels Read As White 0 Answers
Render only certain levels of UI 0 Answers
Image with material is not render 0 Answers
How to draw a gizmo on a Canvas ? 2 Answers