Page 1 of 1

Features having a minimap icon.

Posted: 25 Nov 2009, 20:55
by smoth
So how doable is this for a lua nub like me?

Re: Features having a minimap icon.

Posted: 25 Nov 2009, 20:57
by CarRepairer
I'd suggest making them as gaia units.

Re: Features having a minimap icon.

Posted: 25 Nov 2009, 21:04
by zwzsg
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.

Posted: 25 Nov 2009, 21:21
by smoth
CarRepairer wrote:I'd suggest making them as gaia units.
There is a limit to how many units gaia can have
features are more efficient

thank you z, I will try it out.