Page 1 of 1
Noita Lines In Love2D??
Posted: Mon May 27, 2024 10:25 am
by imDread
Im wondering how can i draw Noita-like lines in love2d, i tried using the "rough" line style, but didnt gave me the result that i was expecting.
Code: Select all
function love.load()
love.window.setMode(500,500)
love.graphics.setLineStyle("rough")
end
function love.draw()
mx,my = love.mouse.getPosition()
love.graphics.setLineWidth(0.1)
love.graphics.line(0,0,mx,my)
end
Anyways this is the code.
Re: Noita Lines In Love2D??
Posted: Mon May 27, 2024 10:51 am
by MrFariator
Might be helpful to provide an example of what you are trying to accomplish. There are fair few wand types in Noita, so it may depend on what effect you're trying to emulate.
Re: Noita Lines In Love2D??
Posted: Mon May 27, 2024 7:38 pm
by imDread
im not trying to create any wand, im just confused how did they render every pixel on the screen , and simulate them to create diffrent lines and effects, if you know how just give me a very simple example.
Re: Noita Lines In Love2D??
Posted: Mon May 27, 2024 11:07 pm
by MrFariator
Okay, so you are not asking about lines, but how to make an engine that simulates every pixel on the screen, and apply effects on top of it? You'd effectively have to make something similar to a voxel engine, but limit it to singular pixels for rendering. That's quite a broad subject, but
the creators of the game did a talk at GDC, if you are interested.
Re: Noita Lines In Love2D??
Posted: Tue May 28, 2024 1:53 pm
by RNavega
That's particles. You draw particles that are 1-pixel wide on screen, and animate them in your code by simulating physical forces like "magnetism" etc. so the points converge to the shapes that you're trying to form.
The fastest way to draw point particles in LÖVE is with a custom Mesh object created with the "points" draw mode, where each flying vertex is drawn as a pixel on screen, and you animate the points by manipulating the vertex coordinates.
It's also an advanced use, and I have no idea how dedicated you are at learning new things.
A much simpler way is using love.graphics.points(), there's an example at the bottom of this page:
https://love2d.org/wiki/love.graphics.points