Scaling the fill

Hello everyone,

I have been trying to use a rect to scroll an space image and it works but when i read through https://coronalabs.com/blog/2013/11/07/tutorial-repeating-fills-in-graphics-2-0/ where it says to scale the fill and use a algorithm i don’t really understand what happens? 

local scaleFactorX = 1 ; local scaleFactorY = 1 if ( object.width > object.height ) then scaleFactorY = object.width / object.height else scaleFactorX = object.height / object.width end

what does the if compare? &gt what is that?

Kind regards

Isak

Hello everyone,

I have been trying to use a rect to scroll an space image and it works but when i read through https://coronalabs.com/blog/2013/11/07/tutorial-repeating-fills-in-graphics-2-0/ where it says to scale the fill and use a algorithm i don’t really understand what happens? 

local scaleFactorX = 1 ; local scaleFactorY = 1 if ( object.width > object.height ) then scaleFactorY = object.width / object.height else scaleFactorX = object.height / object.width end

what does the if compare? &gt what is that?

Kind regards

Isak

There seems to be some sort of formatting error on the page.

&gt is “greater than” i.e. ‘>’

Best regards,

Tomas

Thanks for help Tomas!

Now it works perfect!

Sorry about that guys. WordPress has a nasty habit of converting > and < and similar into their HTML “code equivilants”. I’ve fixed up the post.

Brent

Hello everyone,

I have been trying to use a rect to scroll an space image and it works but when i read through https://coronalabs.com/blog/2013/11/07/tutorial-repeating-fills-in-graphics-2-0/ where it says to scale the fill and use a algorithm i don’t really understand what happens? 

local scaleFactorX = 1 ; local scaleFactorY = 1 if ( object.width > object.height ) then scaleFactorY = object.width / object.height else scaleFactorX = object.height / object.width end

what does the if compare? &gt what is that?

Kind regards

Isak

There seems to be some sort of formatting error on the page.

&gt is “greater than” i.e. ‘>’

Best regards,

Tomas

Thanks for help Tomas!

Now it works perfect!

Sorry about that guys. WordPress has a nasty habit of converting > and < and similar into their HTML “code equivilants”. I’ve fixed up the post.

Brent