I'd like ti a lot if work was put towards creating a primitive drawing library with commands such as:
DrawCircle()
DrawLine()
DrawText()
Blit()
That didnt require any knowledge of OpenGL at all and could just be called there and then in any widget or gadget. Those 4 functions should encompass a lot of the basic 2d graphical operations that people would like to do but dont know how.
The nearest there seems to be is the multiplayer networked line drawing, which is innapropriate.
I'd be willing to help with these sorts of things myself but I dont know how, and nobody else seems to either...=(
Primitive Drawing library
Moderator: Moderators
Drawcircle and the other drawing things need ot be done in a draw callin such as DrawWorldPreUnit
e.g.
e.g.
Code: Select all
local udid = Spring.GetUnitDefID(uid)
local ud = udid and UnitDefs[udid] or nil
if (ud and (ud.radarRadius > 400)) then
gl.Color(0.5, 0.5, 1, 0.5)
local x, y, z = Spring.GetUnitBasePosition(uid)
if (x) then
gl.DrawGroundCircle(x, y, z, ud.radarRadius, 128)
end
end
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Thats easy. Theres a drawline callout for lua that draws the map doodles.
But thats not useful for a lua widget UI. I cant draw a UI button with that coll out, or draw a custom health bar with it.
Right now I can:
draw circles
draw text
and thats it. I cant draw a line between point A and B without resorting to messing with player drawing.
But thats not useful for a lua widget UI. I cant draw a UI button with that coll out, or draw a custom health bar with it.
Right now I can:
draw circles
draw text
and thats it. I cant draw a line between point A and B without resorting to messing with player drawing.