gl.DrawGroundCircle and gl.DrawGroundQuad - help needed

gl.DrawGroundCircle and gl.DrawGroundQuad - help needed

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

gl.DrawGroundCircle and gl.DrawGroundQuad - help needed

Post by knorke »

what i want:
draw on the terrain, in this case to mark units

what i tried:
http://springrts.com/wiki/Lua_OpenGL_Ap ... Primitives

Code: Select all

function widget:DrawScreen()
for i in pairs(builders) do
	local x,y,z=Spring.GetUnitPosition (i)
	gl.DrawGroundCircle (x,y,z, 100, 100,10) --a r=100 circle
	gl.DrawGroundQuad (x-50,z-50, x+50,z+50)	--a 100x100 square
	end
end
what i got:
screen00559.png
(3.94 MiB) Downloaded 3 times
If the unit moves to the right the circle/square move the right too etc, but thats all.
The circles and square are not on the units, dont look like circles or squares. Also they seem to draw on the screen like an GUI element and not on the terrain: when moving the camera, they stay in place.

what i am doing wrong:
your turn
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: gl.DrawGroundCircle and gl.DrawGroundQuad - help needed

Post by knorke »

must use widget:DrawWorld instead of widget:DrawScreen

thanks quantaum
Post Reply

Return to “Lua Scripts”