Page 70 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 30, 2016 10:04 am
by pgimeno
There are also at least two projects that are particle editors.
viewtopic.php?t=81098
viewtopic.php?p=199112#p199112

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Oct 01, 2016 11:30 am
by Zireael
Thanks guys, this is VERY helpful!

However a lack of "LOVE2D based games" page anywhere strikes again - I'm looking for games/libraries that make use of LoveFrames so that I can see their features in action. The more things that are used (lists, scrolling, buttons, checkbox, progressbar, collapsibles...) the better.

Any ideas?

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Oct 02, 2016 5:31 am
by Jasoco
Yeah I don't think Mari0 uses particles since it's trying to mimic SMB which didn't really have any kind of particles excluding the four sprites that appear when you break a block, but that's simple physics and math and not really requiring of a full particle system.

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Oct 02, 2016 8:54 pm
by unixfreak
Trying to texture a polygon shape, previously in 0.9.x you could create a mesh with some vertices and provide a texture to fill the mesh.


https://love2d.org/wiki/love.graphics.newMesh
0.9.x

Code: Select all

mesh = love.graphics.newMesh( vertices, texture, mode )
0.10.x

Code: Select all

mesh = love.graphics.newMesh( vertexformat, vertexcount, mode, usage )
Seems not supported anymore? How can i tile a texture across a mesh or polygon?

So far i have this snippet, but cannot find a way to texture the mesh.

Code: Select all

love.graphics.setColor(255,0,0,255)
local mesh = love.graphics.newMesh(4, "fan", "dynamic")
local verts = { {0, 0},  {0, 0+platform.h}, {0+platform.w,0+platform.h}, {0+platform.w,0}}
				
mesh:setVertices(verts)
love.graphics.draw(mesh, platform.x, platform.y)

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Oct 02, 2016 9:35 pm
by slime
Check out [wiki]Mesh:setTexture[/wiki]

Re: "Questions that don't deserve their own thread" thread

Posted: Tue Oct 04, 2016 7:02 am
by unixfreak
slime wrote:Check out Mesh:setTexture
Oh, many thanks. I overlooked that one.

I have another question related to meshes, the texture is set, but is stretched/blurred to one colour only? How can i set the texture so it is tiled similar to how a quad works? Eg: This is what i get with a mesh texture:

Image

This is the intended look (using quads here)
Image

Is that possible? I just hope to find a way to change the shape of some platforms to a trapezium, etc.
I've set Image:setWrap("repeat", "repeat"), although it doesn't seem to affect meshes?

Re: "Questions that don't deserve their own thread" thread

Posted: Tue Oct 04, 2016 2:03 pm
by s-ol
unixfreak wrote:
slime wrote:Check out Mesh:setTexture
Oh, many thanks. I overlooked that one.

I have another question related to meshes, the texture is set, but is stretched/blurred to one colour only? How can i set the texture so it is tiled similar to how a quad works? Eg: This is what i get with a mesh texture:

Image

This is the intended look (using quads here)
Image

Is that possible? I just hope to find a way to change the shape of some platforms to a trapezium, etc.
I've set Image:setWrap("repeat", "repeat"), although it doesn't seem to affect meshes?
You need to set your u/v coordinates correctly. u/v coordinates range from 0,0 to 0,1; 0,0 being the top left corner of your texture and 1,1 being the bottom right. If you set them on your mesh accordingly you will stretch the texture so it maps onto the platform exactly once. with "repeat" set, you can set the uvs to something like

Code: Select all

0,0  ---------- 6,0
 |              |
0,1 ----------- 6,1
and have it repeat six times over the width.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Oct 05, 2016 12:12 pm
by ingodet
Greetings!
I have put some text next to my cursor but when I move the cursor around the text follows slowly, like it's stuck in some thick liquid or goo.
I tried it out in a fully empty project but still I get the problem. Also tried moving the getPosition() part to love.update but with the same result.
Is this inherit to Löve or am I using it wrong?

Code: Select all

function love.draw()
    mouseX, mouseY = love.mouse.getPosition()
    love.graphics.print("lala", mouseX, mouseY)
end

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Oct 05, 2016 12:57 pm
by MrFariator
ingodet wrote:Greetings!Is this inherit to Löve or am I using it wrong?
It should work just fine, as you can test with lovefiddle here.
Did you modify any of the callbacks that might affect the refresh rate (either in terms for drawing or logic updates)?

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Oct 05, 2016 1:35 pm
by ingodet
MrFariator wrote:It should work just fine, as you can test with lovefiddle here.
Did you modify any of the callbacks that might affect the refresh rate (either in terms for drawing or logic updates)?
No modifications. I also get the same in the lovefiddle version, but not as heavy as inside the game.
The text might be 1 or 2 frames behind the cursor.

I tried recording the screen but on the recording it doesn't seem to have any problems, oddly enough.
I don't think it's hardware related either. i5-3570K and GTX 660. Using windows 10.