Features having a minimap icon.
Moderator: Moderators
Features having a minimap icon.
So how doable is this for a lua nub like me?
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Features having a minimap icon.
I'd suggest making them as gaia units.
Re: Features having a minimap icon.
I suggest directly drawing whatever on the minimap. Exemple from kp_geoshighlight.lua
Code: Select all
-- Draw Mini Map Geos Highlight
local function MiniMapDrawGeosEmplacement()
gl.PushMatrix()
gl.LoadIdentity()
gl.Translate(0,1,0)
gl.Scale(1/Game.mapSizeX,-1/Game.mapSizeZ,1)
for _,geo in ipairs(GeoSpots) do
gl.PolygonMode(GL.FRONT_AND_BACK, GL.FILL) -- default
gl.Rect(geo.x+32,geo.z+32,geo.x-32,geo.z-32)
-- because rectangles disappear when smaller than one pixel, also draw a point
gl.PointSize(1.0) -- default
gl.BeginEnd(GL.POINTS,function()gl.Vertex(geo.x,geo.z)end)
end
gl.PopMatrix()
end
function widget:DrawInMiniMap(sx, sz)
if GeoMiniMapDrawList==nil then
GeoMiniMapDrawList=gl.CreateList(MiniMapDrawGeosEmplacement)
end
gl.Color(0.15,0.5,0.2,1)
gl.CallList(GeoMiniMapDrawList)
gl.Color(1,1,1,1)
end
Re: Features having a minimap icon.
There is a limit to how many units gaia can haveCarRepairer wrote:I'd suggest making them as gaia units.
features are more efficient
thank you z, I will try it out.