I needed the ability to display custom range rings for various things. For example, the purple ring here denotes the range for energy core collection of the Overseer in Evolution RTS, while the orange ring is showing the buildrange. The orange ring disappears when the unit is not selected.
https://code.google.com/p/evolutionrts/ ... mrings.lua
--[[
You can have as many rings as you like.
color = {0.5,0,1,0.3}, --R,G,B,A on a scale from 0 - 1. A is the opacity with 1 being fully opaque to 0 being fully transparent. Easy and quick color picker here: http://www.dematte.at/colorPicker/ Take 255 divided by the color value you want, and that is it's value on a scale from 0 - 1.
radius = 500, --How large of a radius the ring will cover.
linewidth = 1, --1 is basically 1 pixel thick. It will scale as you zoom in and out. Maximum value seems to be 32.
]]--
Code: Select all
local ringsDefs = {
[UnitDefNames.ecommander.id] = {
{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 },
{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 },
},
}