"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
slime
Solid Snayke
Posts: 3161
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 »

Dr.Tyler O. wrote:Is it possible to use Fixture:setFilterData() while still letting those fixtures produce collision callbacks? I'm aware that it sounds silly but the collision callbacks are what I'm using to detect whether the players in my video game touch items. I just don't want the items to slow the player down with collisions.
Turning the Fixture into a sensor might be what you want, rather than using collision filtering.
User avatar
Dr.Tyler O.
Citizen
Posts: 58
Joined: Tue Jul 29, 2014 9:17 am
Location: United States

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

Post by Dr.Tyler O. »

slime wrote:Turning the Fixture into a sensor might be what you want, rather than using collision filtering.
But, from my understanding, sensors don't collide with anything. I need to make it so that the body only collides with static bodies.
Any topic I have ever posted that I felt did not require a .love file, although they were requested, never required one so I would appreciate if you did not ask me to supply one unless you think that I am ignorant for not doing so.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Then have a look at [wiki]Fixture:setCategory[/wiki], [wiki]Fixture:setMask[/wiki] and [wiki]Fixture:setFilterData[/wiki].
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

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

Post by Zilarrezko »

Ah thanks slime, didn't know you didn't have to use all the indices. My knowledge of C++ is very limited. It's very sad, I know assembly more than C++.
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post by Whatthefuck »

In XNA you can add any texture to a single spritebatch, in Love2D you need a separate spritebatch for every separate texture. What's up with that?
User avatar
slime
Solid Snayke
Posts: 3161
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 »

The concept behind a LÖVE SpriteBatch is a little different from the concept behind an XNA SpriteBatch, even though they have the same name. LÖVE's can get drastically better performance in many situations as a result, but they're slightly less flexible.

Switching between different textures within a single begin-end pair an XNA SpriteBatch comes at a performance cost, and that cost would be there in LÖVE as well if that feature was implemented. You'll get the best performance in both frameworks by using Quads (or their equivalent) with a texture atlas and a SpriteBatch.
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post by Whatthefuck »

slime wrote:The concept behind a LÖVE SpriteBatch is a little different from the concept behind an XNA SpriteBatch, even though they have the same name. LÖVE's can get drastically better performance in many situations as a result, but they're slightly less flexible.

Switching between different textures within a single begin-end pair an XNA SpriteBatch comes at a performance cost, and that cost would be there in LÖVE as well if that feature was implemented. You'll get the best performance in both frameworks by using Quads (or their equivalent) with a texture atlas and a SpriteBatch.
Is there a possibility you guys could add another spritebatch class that'd behave like it does in XNA? I am using an atlas texture + quads + spritebatch to draw the world, but for misc objects I'm in a need of said flexibility that the XNA spritebatch provides.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

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

Post by rmcode »

How would I add multiple shaders to the same image? This obviously wouldn't work since the second shader would overrule the first one.

Code: Select all

        love.graphics.setShader(foo);
        love.graphics.setShader(bar);
        buttons:draw();
        love.graphics.setShader();
So I guess I need to draw the image to a canvas, apply the first shader, update the canvas and then apply the second shader to the canvas? If so, should the canvas be updated in the update() callback?
Bya
Prole
Posts: 20
Joined: Sat Sep 06, 2014 4:24 am

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

Post by Bya »

How would one delete an entity? Like, completely wipe it from the current game. I.e, once an enemy is defeated, to delete it completely so it doesn't show up, follow the player, do anything that it would normally do.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

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

Post by Plu »

Usually entities are stored in a table, so to get rid of it you find its key in that table and then set that value to NIL.

Of course, the harder part is to make sure that any other references to it are also dropped, but that depends a bit on how your game is designed, I think.
Locked

Who is online

Users browsing this forum: Bing [Bot], MaxChri and 3 guests