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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Locked
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

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

Post by pgimeno »

There are also at least two projects that are particle editors.
viewtopic.php?t=81098
viewtopic.php?p=199112#p199112
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

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

Post 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?
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

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

Post 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.
User avatar
unixfreak
Citizen
Posts: 82
Joined: Thu Oct 15, 2015 6:25 am
Location: Bristol, UK
Contact:

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

Post 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)
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

Check out [wiki]Mesh:setTexture[/wiki]
User avatar
unixfreak
Citizen
Posts: 82
Joined: Thu Oct 15, 2015 6:25 am
Location: Bristol, UK
Contact:

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

Post 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?
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

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

Post 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.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
ingodet
Prole
Posts: 3
Joined: Wed Oct 05, 2016 12:03 pm

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

Post 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
MrFariator
Party member
Posts: 512
Joined: Wed Oct 05, 2016 11:53 am

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

Post 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)?
ingodet
Prole
Posts: 3
Joined: Wed Oct 05, 2016 12:03 pm

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

Post 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.
Locked

Who is online

Users browsing this forum: slime and 161 guests