Drawing triangle
Drawing triangle
Is there a way to draw a triangle with 2 sides black 1 side gray and filled red without using image files? Is there a way to make a custom DrawMode?
Re: Drawing triangle
It seems that LOVE treats all the line segments of a polygon as one object, rather than separate objects (maybe it doesn't in the interior, but I don't think you a simple way of accessing it at that level). I'd say that you could just draw additional lines on top of the triangle and change their color individually.
Re: Drawing triangle
Thats what i was thinking I just wanted to know if anyone knew a better way.
EDIT: Is there a way I can group the lines and the triangle together so I could rotate/move them togeter or would I need to move each one individuality
EDIT: Is there a way I can group the lines and the triangle together so I could rotate/move them togeter or would I need to move each one individuality
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Drawing triangle
Kurosuke needs beta testers
Re: Drawing triangle
What tentus said, or you could create a custom class:
I prefer this way, but I came from C++ and C#, so making classes is second nature.
Code: Select all
triangle = {}
triangle.__index = triangle
-- class constructor
function newCustomTriangle(vertices, linecolor1, linecolor2, tricolor)
local t = {}
t.v = vertices
t.lc1 = linecolor1
t.lc2 = linecolor2
t.tc = tricolor
return setmetatable(t, triangle)
end
function triangle:rotate(r)
-- rotate
end
function triangle:translate(t)
-- translate
end
function triangle:draw()
-- draw
end
Re: Drawing triangle
Thanks. I'm actually doing that nowWhat tentus said, or you could create a custom class:
Same here. I've been away from programming for a few years so I'm getting used to it agianI prefer this way, but I came from C++ and C#, so making classes is second nature.
Who is online
Users browsing this forum: No registered users and 5 guests