Drawing Quads
Posted: Mon Oct 13, 2014 9:03 pm
When you create a quad using love.graphics.newQuad, is there any particular reason that the image is not stored as part of the data?
What I mean by that is this:
Why should I have to do
Why can I not just do this:
This would be more like the traditional love.draw method and less confusing, in my opinion.
It could be argued that this keeps less typing (i.e. not typing the image every time you make a new quad), which I understand.
It could also be argued that it is a good coding method to remind you that it is a quad, and not an image, or for flexibility (but are there any examples of this?).
I'm just wondering, that's all. I think this would be better, but I'm no engine developer, just a curious programmer. Thanks.
What I mean by that is this:
Why should I have to do
Code: Select all
local Image = love.graphics.newImage( 'Image.png' )
local Quad = love.graphics.newQuad( 0, 0, 32, 32, 32, 32 )
-- Later:
love.graphics.draw( Image, Quad, 0, 0 )
Code: Select all
local Image = love.graphisc.newImage( 'Image.png' )
local Quad = love.graphics.newQuad( Image, 0, 0, 32, 32, 32, 32 )
-- Later
love.graphics.draw( Quad, 0, 0 )
It could be argued that this keeps less typing (i.e. not typing the image every time you make a new quad), which I understand.
It could also be argued that it is a good coding method to remind you that it is a quad, and not an image, or for flexibility (but are there any examples of this?).
I'm just wondering, that's all. I think this would be better, but I'm no engine developer, just a curious programmer. Thanks.