Issue with (Image):setWrap (Solved)

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.
Post Reply
2dcode
Prole
Posts: 3
Joined: Wed Mar 05, 2014 3:00 am

Issue with (Image):setWrap (Solved)

Post by 2dcode » Wed Mar 05, 2014 3:10 am

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.

User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 » Wed Mar 05, 2014 4:48 am

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.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.

2dcode
Prole
Posts: 3
Joined: Wed Mar 05, 2014 3:00 am

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

Post by 2dcode » Wed Mar 05, 2014 5:21 am

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.

User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

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

Post by Azhukar » Wed Mar 05, 2014 9:04 am

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.

User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 » Wed Mar 05, 2014 3:35 pm

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.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.

2dcode
Prole
Posts: 3
Joined: Wed Mar 05, 2014 3:00 am

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

Post by 2dcode » Thu Mar 06, 2014 2:24 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests