Page 1 of 1

Issue with (Image):setWrap (Solved)

Posted: Wed Mar 05, 2014 3:10 am
by 2dcode
Delightful forums forced me to re read my code with fresh eyes. Solution found.

The issue delt with (Image):setWrap and I merely swap image variables during a copy paste session.

Re: Issue with (Image):setWrap (Solved)

Posted: Wed Mar 05, 2014 4:48 am
by Ranguna259
So.. The question was .. ?

EDIT: And if you mean that no one replied to your post then remember that it's 4 AM in GMT +0:00 right now, people are asleep.

Re: Issue with (Image):setWrap (Solved)

Posted: Wed Mar 05, 2014 5:21 am
by 2dcode
It had to do with the way setWrap was acting like it was set to the default clamped instead of repeat when I had set it to repeat. I was being literal, the forums here are active and get quick intelligent responses. The fact that I knew I could actually post here and get help sent me about making a detailed post with the relevant code links and screenshot. It wasn't till I was reviewing the post later after a short break that I debugged it myself. This forum is a great resource and I'm glad we have it available.

The one thing (not to hijack a thread) I was wondering about is documentation or tutorials on efficiency. I'm currently limiting draw calls and I hear the canvas and batching help too but if anyone who reads this happens to have a guide to keeping love efficient I'd love to read it.

Re: Issue with (Image):setWrap (Solved)

Posted: Wed Mar 05, 2014 9:04 am
by Azhukar
2dcode wrote:if anyone who reads this happens to have a guide to keeping love efficient I'd love to read it.
I'm not aware of any efficiency guide, but here are some general pointers for drawing:

Do not recreate that which you can reuse.
Example: creating images/anything non-trivial every frame vs once in load/after change.

If you think you can use a spritebatch, you probably should use a spritebatch.
Example: making a lot of draw calls to draw terrain vs one spritebatch.

Re: Issue with (Image):setWrap (Solved)

Posted: Wed Mar 05, 2014 3:35 pm
by Ranguna259
I'm glad you find it great :P

My two cents on efficiency:
Don't use

Code: Select all

love.graphics.newFont()
and

Code: Select all

love.graphics.setNewFont()
repeatedly, or else you'll make a RAM bomb.

Re: Issue with (Image):setWrap (Solved)

Posted: Thu Mar 06, 2014 2:24 am
by 2dcode
Indeed, I've been keeping all my decelerations and initializations in love.load() with the exception of some redraws and collisions checks. I've been trying to hide everything behind if statements to keep blocks from having to execute every cycle and with batch drawing or depending on how the canvas works the redraw for the actual on screen elements might even be able to be simplified. I'm still having to do box collision checks which requires checking the protagonists box against all the collideables. That seems a little much but I'm not sure how to simplify it. Good advice, I'll check out sprite batches more. I know there are some programs to auto build the sprite sheets too.