How do I work with localAnimator and world coordinates? Depending on where I am the UI elements I rendered disappear. I've observed this even with my prior mod, Project 42. I need help understanding the coordinate system and how localAnimator.addDrawable() works with it.
I've come up with a finicky solution specifically for project 42, worldifying the coors of the line indicator for the alt ability, where alfa and beta are the vectors to worldify:
function worldify(alfa, beta)
local a = alfa
local b = beta
local xmax = world.size()[1]
local dispvec = vec2.sub(b, a)
if a[1] > xmax/2 then
a[1] = -1 * (xmax - a[1])
end
b = vec2.add(a, dispvec)
return {a, b}
end
I forgot why this works, could someone help me understand? thanks
It's 3am and we have 7am classes tomorrow so I just typed away my question and hope for an answer tomorrow (i'll add more details and clarifications when i get up 💀)
