Most efficient way to draw a tilegrid(spritebatch vs canvas)

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.
User avatar
tv_user
Citizen
Posts: 57
Joined: Sun Aug 12, 2012 4:39 pm
Location: Portugal

Re: Most efficient way to draw a tilegrid(spritebatch vs can

Post by tv_user »

Why would you want to keep changing the quads in a sprite batch? Isn't the spritebatch is supposed to work like a tile map: you create it and load an entire map once (at the beginning of the game or upon entering the area) and then just render it every frame with the desired X and Y displacement?
I must admit I've never used it before, but I would only find it useful if it works like this. Otherwise, I'd just design myself a 'class' to handle a quad array. That would probably be the best and most optimized way to draw a tile map.
What do you guys think?

EDIT: ok, after checking the wiki for a while I realize that a spritebatch is just a bunch of sprites and/or quads that are grouped to be rendered together. It doesn't seem to be possible to move a sprite batch along the Y/X axis, is it?
Did my comment help/offended you? Use the Karma button!!
LÖVEing each day...
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 10 guests