factorite/drawutil.lua
2020-10-04 04:18:24 +03:00

14 lines
No EOL
696 B
Lua

function arrow(x, y, w, h, a)
love.graphics.line(
x + w/2 + math.sin(math.rad(a + 180)) * w/2 * 0.8, y + h/2 + math.cos(math.rad(a + 180)) * h/2,
x + w/2 + math.sin(math.rad(a)) * w/2 * 0.8, y + h/2 + math.cos(math.rad(a)) * w/2
)
love.graphics.line(
x + w/2 + math.sin(math.rad(a + 180)) * w/2 * 0.8, y + h/2 + math.cos(math.rad(a + 180)) * h/2,
x + w/2 + math.sin(math.rad(a + 100)) * w/2 * 0.8, y + h/2 + math.cos(math.rad(a + 100)) * h/2
)
love.graphics.line(
x + w/2 + math.sin(math.rad(a + 180)) * w/2 * 0.8, y + h/2 + math.cos(math.rad(a + 180)) * h/2,
x + w/2 + math.sin(math.rad(a - 100)) * w/2 * 0.8, y + h/2 + math.cos(math.rad(a - 100)) * h/2
)
end