Manipulating image transparency
by Nathan Bowhay - ESAL · in Torque Game Engine · 11/24/2006 (12:55 pm) · 3 replies
I am trying to create a fog of war on the mini-map.
I know there is a post about this, but I don't want to only render parts, I want to render a black image over the entire minimap and change the transparency of parts of it so that the minimap shows through.
An example of this being done is when you have 2 layers in photoshot (one black and one red with the black one on top) you then take the eraser and move it over the black layer. I want to do this in torque.
so I basically want to take a black image and be able to (given a x,y pos on it) change the transparency of that spot (or its radius). The changes need to stay until torque is closed.
If anyone can help or at least point me in the correct direction that would be great.
I have some knowledge of openGL.
Here is my original post in the openGL forums (got no hits for quit some time):
Revealing where units have been
I know there is a post about this, but I don't want to only render parts, I want to render a black image over the entire minimap and change the transparency of parts of it so that the minimap shows through.
An example of this being done is when you have 2 layers in photoshot (one black and one red with the black one on top) you then take the eraser and move it over the black layer. I want to do this in torque.
so I basically want to take a black image and be able to (given a x,y pos on it) change the transparency of that spot (or its radius). The changes need to stay until torque is closed.
If anyone can help or at least point me in the correct direction that would be great.
I have some knowledge of openGL.
Here is my original post in the openGL forums (got no hits for quit some time):
Revealing where units have been
#2
12/09/2006 (12:36 pm)
I dont know what mini-map you are using. But you might be able to use an PNG with a big spot in the middle that alpha from solid at the edges to clear in the center. Then take that PGN as the mini-map overlay.
#3
Caylo's idea works for a "flashlight" fogofwar, where you get your immediate area shown and the rest is black. Basically you get a big square and cut a hole out of the center, then overlay that on your minimap.
For a revealing fogofwar (like warcraft/starcraft), I would cover my minimap with a grid of black circles, whenever the player moves to a new circle, it becomes transparent, while all the rest the player has visited become half-transparent, half black.
Maybe the RTS kit has a better way of doing it?
12/11/2006 (12:08 pm)
It depends if you want a "flashlight" fogofwar, or a revealing fogofwar.Caylo's idea works for a "flashlight" fogofwar, where you get your immediate area shown and the rest is black. Basically you get a big square and cut a hole out of the center, then overlay that on your minimap.
For a revealing fogofwar (like warcraft/starcraft), I would cover my minimap with a grid of black circles, whenever the player moves to a new circle, it becomes transparent, while all the rest the player has visited become half-transparent, half black.
Maybe the RTS kit has a better way of doing it?
Torque 3D Owner Nathan Bowhay - ESAL
ESALPllc