Scissor Speed

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Pinkishu
Prole
Posts: 5
Joined: Sat Mar 16, 2013 5:56 pm

Scissor Speed

Post by Pinkishu »

Hey there,

so i'm drawing a level on the screen, basically just a set of tiles (which each are 16x16px)
But the level is likely to exceed the space on the screen, thus i'm wondering if its enough to set a scissor of the full window size (or is that unneeded/the default) to not waste time trying to draw tiles that aren't on the screen anyway; or if it would performance-wise be better to calculate which tiles are actually on the screen and only draw those anyway.
User avatar
slime
Solid Snayke
Posts: 3170
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Scissor Speed

Post by slime »

The best tile optimization you can do is to use a SpriteBatch (explained a bit more here.)
If you're drawing individual tiles with love.graphics.draw, it will probably be much more efficient to calculate and draw only the onscreen tiles rather than just using a scissor, depending on how your tile data structure is set up.

SpriteBatches and Sprite Sheets go hand-in-hand: http://www.codeandweb.com/what-is-a-spr ... erformance
Pinkishu
Prole
Posts: 5
Joined: Sat Mar 16, 2013 5:56 pm

Re: Scissor Speed

Post by Pinkishu »

Ok, looked into that and had some help on the LÖVE IRC also :3 Thanks ^^
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests