Is this a bug or can someone explain?

To me it LOOKS like a bug.

However, since I am a newbie, I thought I would ASK before “submitting” the bug.

Ok, background. I am a math instructor/professor - so this just doesn’t look right. Well, definitely not what I wanted.

I am on Using Corona SDK Mobile Game Development
Page 68

I made the following changes to see “how things work” (I like to experiment)
image02.xScale =0.5
image03.rotation = 45
image03.xScale =0.5

Now, image02 looks exactly like how I expect it to look “shrunk” in the x-axis but same size in the y.
However, image03 doesn’t look like what I expected.
In fact it looks like
image04.yScale=0.5 (I added this to try to figure out what I saw) flipped over its yCenter (mathematically speaking).
The reason it doesn’t look like what I expected is because it appears that the x length is 100% instead of 50%.

So, I thought of the following. Maybe they shrunk the original image then rotating it - and rotation of the image makes it appear to be longer than it is. I created 2 red lines that ran down the edges of the first image and that is my best guess as to what they did.

To me that is wrong (from a math point of view). My guess is because there is no “order of operations” between xScale and rotation. Because of that, they had to decide what to do when xScale and rotation are both used. Because what I wanted to happen was rotation THEN xScale. But what really happened was xScale THEN rotation. Correct???

So, if I REALLY wanted rotation THEN xScale - I guess I would have to save the rotation file - then reload it then xScale it. Am I correct?

Thanks for your help!
Is this ok, if I use this forum for my MANY questions?
[import]uid: 159663 topic_id: 28203 reply_id: 328203[/import]

I’m having a little trouble picturing this, would you happen to have a screenshot you could share with me, please? :slight_smile: [import]uid: 52491 topic_id: 28203 reply_id: 114071[/import]

Yes, I do, but I have no idea how to attach a picture here.

How do you do that?

Anyway I put it on my website

http://www.tianjinuniversal.com/whythirdisnothalfsize.jpg

Ignore the other objects - was testing more from the book.

Thanks!
[import]uid: 159663 topic_id: 28203 reply_id: 114087[/import]

OK, I looked at your image and reread the original post a couple times -

You want to rotate the image and stretch/shrink on the X axis (for example, it could also by Y or both but let’s keep this simple) and your confusion comes from the fact that if you rotate the image 90 degrees (for example) then say obj.xScale = 2 that it would get taller, not wider, regardless of whether the rotation took place before or after the scaling.

Is that correct?

If not perhaps you might try elaborating again (the various image names earlier got a little odd, I wasn’t sure where 2, 3 and 4 all played their parts) and uploading or providing something plug and play to demonstrate the issue further, possibly? [import]uid: 52491 topic_id: 28203 reply_id: 114188[/import]

Well, lets just keep that image and let me explain again.

the moons from top to bottom are:
image1
image2
image3
image4

Now image2 is xScale 0.5 (looks great!!! x width is half the normal)
Now image3 is ALSO xScale 0.5 but it has a rotation of 45
I expected image3 to be a rotation THEN xScaled (in otherwords the FINAL image to LOOK like the x width is half the normal, just like image2 but on an angle)

So, it APPEARS you all are scaling first THEN rotating.

My question is - what do I need to do if I want it rotated THEN scaled? I THINK I have to rotate it - then save it then load it again then scale it.

I think I made it as simple as it needs to be. PLAIN and simple if I have xScale 0,5 then the x-width of final product SHOULD be 1/2 of the original image3 fails that.

Thanks!
[import]uid: 159663 topic_id: 28203 reply_id: 114211[/import]

Now, you all are going to probably tell me, that the xScale is 0.5 but the x is now rotated, so you have to look at the angle 45 to see the x axis.

Then that is fine.

So, my question ONCE again is.
WHAT if I wanted my FINAL layout to be xScaled 0.5 and it was rotated 45. MY GUESS is that I have to rotate it 45 then save it - then load it then xScale it.

ANY other way to accomplish what I want?

Thanks! [import]uid: 159663 topic_id: 28203 reply_id: 114212[/import]

Indeed, that is correct - save and reload, or use multiple images. [import]uid: 52491 topic_id: 28203 reply_id: 114268[/import]