love.graphics.newQuad's reference height and width

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
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

love.graphics.newQuad's reference height and width

Post by kikito » Sat Jan 16, 2010 2:28 pm

I'm a bit puzzled about the last two parameters of newQuad (sw and sh in the docs)

Am I right to assume that these must always be the height and width of the "source" image?

If yes, can someone explain to me why are they needed in the first place? The width and height of the image are available on the source image itself (image:getWidth / image:getHeight).
When I write def I mean function.

User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: love.graphics.newQuad's reference height and width

Post by TechnoCat » Sat Jan 16, 2010 4:16 pm

I am not sure what use they are, but they affect the scale.

User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: love.graphics.newQuad's reference height and width

Post by rude » Sat Jan 16, 2010 5:47 pm

kikito wrote:Am I right to assume that these must always be the height and width of the "source" image?
Yes. It is used to pre-calculate the texture coordinates when the Quad is created. The Quad does not know which Image it will be used with.

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests