attempted to use Graphoon, but it just crashes

This commit is contained in:
2025-11-04 20:45:37 -07:00
commit 5f3656c816
7 changed files with 527 additions and 0 deletions

24
src/main.lua Normal file
View File

@@ -0,0 +1,24 @@
local Graphoon = require "lib.Graphoon"
local graph = Graphoon.Graph.new()
-- it just crashes :D
graph:addNode("Name", 100, 100, true) -- magic numbers are a position and anchor to that position
graph:addNode("Another")
graph:connectIDs("Name", "Another")
function love.draw()
graph:draw(function(node)
local x, y = node:getPosition()
love.graphics.circle("fill", x, y, 5)
end,
function(edge)
local origin_x, origin_y = edge.origin:getPosition()
local target_x, target_y = edge.target:getPosition()
love.graphics.line(origin_x, origin_y, target_x, target_y)
end)
end
function love.update(dt)
graph:update(dt)
end