"Questions that don't deserve their own thread" thread
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 106
- Joined: Sat Jun 21, 2014 3:45 pm
Re: "Questions that don't deserve their own thread" thread
But there is a huge difference in amount of memory used between a spritebatch that was first created and had nothing done to it and one that was filled and then cleared, why is that?
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: "Questions that don't deserve their own thread" thread
I lied a bit - some of the memory allocation is deferred (both in LÖVE's code and, in some circumstances, in the video driver's code.) The amount of memory allocated should remain fairly constant after that though.
Re: "Questions that don't deserve their own thread" thread
I can't get animations to work either with AnAL or anim8, so I decided I would just manually swap out images, which is working fine, except I can't figure out how to "delay" the image change instead of it being what I assume is an instantaneous swap. How would I go about delaying it?
Re: "Questions that don't deserve their own thread" thread
You can't, not really. You'll have to delay it manually:
Incidentally, this is exactly what anal and anim8 also do.
Code: Select all
maxTime = 0.2
curTime = 0
function love.update( dt )
curTime = curTime + dt
if curTime > maxTime then
-- go to the next step of your animation
curTime = curTime - maxTime -- for smoothness, don't just go back to 0
end
end
Re: "Questions that don't deserve their own thread" thread
I'm playing with hardoncollider. I did the tutorial once but I feel it hasn't quite prepared me, so I have a few questions.
1) Do you tie images to the shapes (coordinate-wise)? It sort of seems like the sensible thing to do, but I'm not sure.
2) Do you use move or moveTo? Is there a serious drawback to one or the other?
3) I have something like gravity (basically just velocity for the y axis) and collision with the ground. If the pc collides with the ground it gets reset to the position of the ground (using moveTo). The outline of the rectangle I'm drawing jitters up and down like crazy, that seems not a sensible thing to do. Not sure what's wrong.
1) Do you tie images to the shapes (coordinate-wise)? It sort of seems like the sensible thing to do, but I'm not sure.
2) Do you use move or moveTo? Is there a serious drawback to one or the other?
3) I have something like gravity (basically just velocity for the y axis) and collision with the ground. If the pc collides with the ground it gets reset to the position of the ground (using moveTo). The outline of the rectangle I'm drawing jitters up and down like crazy, that seems not a sensible thing to do. Not sure what's wrong.
-
- Prole
- Posts: 19
- Joined: Sat Sep 06, 2014 8:50 pm
Re: "Questions that don't deserve their own thread" thread
Can I get someone to clear up some wording on the wiki for me? I can't sort this out... it's from the [wiki]Fixture:setFilterData[/wiki] page on the wiki -
okay.. I can get behind that, but heres the real tricky bit next..
huh? I thought they didnt collide? How are they getting a return value from a collision if it isn't occurring? What is the return value being used for? Which custom collision function are we talking about here? Are they colliding or are they not colliding? WHAT'S GOING ON
The first part makes sense. Always collide or never collide if the group number matches as positive numbers or negative numbers respectively. Got it. The next part though, is a bit more confusing.If two fixtures are in the same group they either always collide if the group is positive, or never collide if it's negative. Is the group zero or they do not match, then the contact filter checks if the fixtures select a category of the other fixture with their masks. The fixtures do not collide if that's not the case. If they do have each others categories selected, the return value of the custom contact filter will be used. They always collide if none was set.
Okay... so, the filters 'select a cetegory with their mask'... I think this means, "check to see if object_a.mask contains object_b.category or vice versa"Is the group zero or they do not match, then the contact filter checks if the fixtures select a category of the other fixture with their masks.
okay.. I can get behind that, but heres the real tricky bit next..
Okay, so if A.mask contains B.category, no collision. got it. but wait, the next sentence is "if they do have each others categories selected, the return value of the custom contact filter will be used."The fixtures do not collide if that's not the case. If they do have each others categories selected, the return value of the custom contact filter will be used. They always collide if none was set.
huh? I thought they didnt collide? How are they getting a return value from a collision if it isn't occurring? What is the return value being used for? Which custom collision function are we talking about here? Are they colliding or are they not colliding? WHAT'S GOING ON
- 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
I'm sure that almost everyone here is aware that when something like love.graphics.rectangle is executed it draws a rectangle that expands from the center point that it was created on. My question to you is, is there a way to make a rectangle only expand in a single direction on a given axis instead of it expanding in both directions?
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.
-
- Prole
- Posts: 19
- Joined: Sat Sep 06, 2014 8:50 pm
Re: "Questions that don't deserve their own thread" thread
The same difficulty happens when you are drawing rectangle shaped bodies in love.physics. I solved the problem by only using the polygon function and manually creating a rectangle --that is to say, I used love.physics.newPolygonShape(vertices of a rectangle) rather than love.physics.newRectangleShape(height and width). Using that, the rectangle s origin was the top right, as I had intended.Dr.Tyler O. wrote:Is there a way to make a rectangle only expand in a single direction on a given axis instead of it expanding in both directions?
I'm not certain if that will work for the drawing tools as well, but perhaps it's worth investigating?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: "Questions that don't deserve their own thread" thread
love.graphics.rectangle(centerx - width/2, centery - height/2, width, height) should do the trick.
Help us help you: attach a .love.
Re: "Questions that don't deserve their own thread" thread
Snackrilege, that's not an easy subject at all unfortunately
I found this tutorial which explains it pretty well, however the code samples are in some form of C (because it's explaining box2d, the system behind love.physics)
I think it'll help you understand what's going on. If you have more questions on the subject, you should probably make your own thread as it's a complicated subject that'll probably take a lot of posts to grasp.
http://www.iforce2d.net/b2dtut/collision-filtering
I found this tutorial which explains it pretty well, however the code samples are in some form of C (because it's explaining box2d, the system behind love.physics)
I think it'll help you understand what's going on. If you have more questions on the subject, you should probably make your own thread as it's a complicated subject that'll probably take a lot of posts to grasp.
http://www.iforce2d.net/b2dtut/collision-filtering
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest