PORTRAIT and Landscape Orientation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
PORTRAIT and Landscape Orientation
I want to automatically resize a graphic when the user turns the ipad to change its orientation.
I have this code:
SET THE RECT of img "bg" to the rect of this card
Where do I put this message?
Thanks, Max
I have this code:
SET THE RECT of img "bg" to the rect of this card
Where do I put this message?
Thanks, Max
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: PORTRAIT and Landscape Orientation
I believe the nest place for all such resizing would be in a resizeStack handler, no?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: PORTRAIT and Landscape Orientation
I tried this, and its works fine for initial orientation.But when I rotate the IPAD left, the resizeStack message does no seem to get called. Am I missing something?
on resizeStack
set the rect of img "MP" to the rect of this window
set the top of img "MP" to ( the top of this window- 64)
set the left of img "MP" to ( the left of this window- 661)
end resizeStack
Thank you Richard.
on resizeStack
set the rect of img "MP" to the rect of this window
set the top of img "MP" to ( the top of this window- 64)
set the left of img "MP" to ( the left of this window- 661)
end resizeStack
Thank you Richard.
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: PORTRAIT and Landscape Orientation
Hmmm...I had thought resizeStack would be sent in all circumstances which changed the stack rect, but perhaps try orientationChanged instead.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: PORTRAIT and Landscape Orientation
I tried every concievable way to use resizestack and Orientationchanged, but the shape keeps distorting out of the window.
Has anyone had success resizing images for different orientations?
Has anyone had success resizing images for different orientations?
Re: PORTRAIT and Landscape Orientation
Hi Maxs,
I've had no problem before.
But the -64 and - 661 will push the image off the screen since it's the same size as the stack.
What do you want to happen?
Simon
I've had no problem before.
But the -64 and - 661 will push the image off the screen since it's the same size as the stack.
What do you want to happen?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: PORTRAIT and Landscape Orientation
Hi Simon
I just want to set the rect of img "MP" to the rect of this window
But the image keeps shifting right and down when I change the orientation.
I just want to set the rect of img "MP" to the rect of this window
But the image keeps shifting right and down when I change the orientation.
Re: PORTRAIT and Landscape Orientation
Hi Maxs,
But isn't that what you are asking it to do?
Simon
But isn't that what you are asking it to do?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: PORTRAIT and Landscape Orientation
Instead of setting the top and left, set the loc. For landscape it will be 512,384 and portrait: 384,512 (assuming iPad non-retina)
Also check your settings for the iOS output - there are 4 checkboxes at the bottom of the left column - make sure they are all ticked.
Also try the resizeStack handler on the card as opposed to the stack level script - for me the stack level one didn't actually get called! But when I moved the same handler to the card it worked perfectly!
Hope some of that helps.
Cheers,
Dave
Also check your settings for the iOS output - there are 4 checkboxes at the bottom of the left column - make sure they are all ticked.
Also try the resizeStack handler on the card as opposed to the stack level script - for me the stack level one didn't actually get called! But when I moved the same handler to the card it worked perfectly!
Hope some of that helps.
Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: PORTRAIT and Landscape Orientation
Hi Simon,
No I was using the offset to compensate to the extra margins the seem to appear for no reason. But that only made the problem worse.
No I was using the offset to compensate to the extra margins the seem to appear for no reason. But that only made the problem worse.
Re: PORTRAIT and Landscape Orientation
Hi Maxs,
Try using "effective"
on resizeStack
set the rect of img "MP" to the effective screenRect
Simon
Try using "effective"
on resizeStack
set the rect of img "MP" to the effective screenRect
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: PORTRAIT and Landscape Orientation
Thanks, Simon for staying with me.
the set the rect of img "MP" to the effective screenRect gives an error.
For some reason when I try to set the rect of any object to the window, I get a 1 inch border.
I'm thinking of trashing my preferences folder.
Does anyone remember where the Livecode preferences are stored?
Max
the set the rect of img "MP" to the effective screenRect gives an error.
For some reason when I try to set the rect of any object to the window, I get a 1 inch border.
I'm thinking of trashing my preferences folder.
Does anyone remember where the Livecode preferences are stored?
Max
Re: PORTRAIT and Landscape Orientation
OH,
I think it might be:
effective working screenRect
Simon
EDIT: I've never heard of people using "window" to fill the screen with an image. screenRect, yes.
I think it might be:
effective working screenRect
Simon
EDIT: I've never heard of people using "window" to fill the screen with an image. screenRect, yes.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: PORTRAIT and Landscape Orientation
THanks again Simon,
Using the word "working" helped. I have a big monitor to the image really zoomed out.
I also found this to help
set the rect of img "MP" to the rect of this window
set the top of img "MP" to "0"
set the left of img "MP" to "0"
Using the word "working" helped. I have a big monitor to the image really zoomed out.
I also found this to help
set the rect of img "MP" to the rect of this window
set the top of img "MP" to "0"
set the left of img "MP" to "0"
Re: PORTRAIT and Landscape Orientation
Simon,
and its abbreviation
-> wd
is a snyonym for stack!
Just looked this up in the dictionary and FINALLY know the abbreviation for STACK!
Best
Klaus
-> windowSimon wrote:I've never heard of people using "window" to fill the screen with an image. screenRect, yes.
and its abbreviation
-> wd
is a snyonym for stack!
Just looked this up in the dictionary and FINALLY know the abbreviation for STACK!

Best
Klaus