Page 1 of 1
Open a centered modal?
Posted: Thu Feb 10, 2011 2:00 am
by dburdan
Hi,
I am trying to open a modal that is automatically centered on top of the current stack. For example, I need user input so I made a modal stack. I can open it fine but I want it to be half the size of the stack that opens it and be centered on the screen. Example:
What I have:
What I want:
The back box is the modal stack.
Re: Open a centered modal?
Posted: Thu Feb 10, 2011 3:19 am
by RickD
Hi dburdan:
I have attached a sample stack that does what you want.
It has a preopenCard script and two button scripts. Very staraight forward.
Hope this helps.
Cheers
Re: Open a centered modal?
Posted: Thu Feb 10, 2011 6:29 pm
by dburdan
That works great for the computer however I'm building on iOS. Every time I open a modal window It covers the whole screen. I can't get the sides to be transparent.
Re: Open a centered modal?
Posted: Thu Feb 10, 2011 7:24 pm
by Klaus
Hi Dan,
since iOS is a ONE window environment, there can only be ONE stack on the screen at a time
and it will cover the complete screen! So what you wnat to achieve is simply impossible (right now).
I would fake this by creating a card in your current stack that LOOKS as if a modal dialog is open over my stack
Best
Klaus
Re: Open a centered modal?
Posted: Thu Feb 10, 2011 7:40 pm
by dburdan
Ok, thanks once again Klaus

!
Re: Open a centered modal?
Posted: Thu Feb 10, 2011 8:03 pm
by Klaus
Dan, think different!

Re: Open a centered modal?
Posted: Thu Feb 10, 2011 9:05 pm
by SteveHanlan
I create a control whose visible is false until I need it.
Combine this with a function that disables other visible controls temporarily and you have an effective modal pop-up
If you can stand illogical control names, I name them sequentially, i.e. c1, c2, c3, etc. This make it easy to enable/disable in a repeat loop
Cheers
Steve
Re: Open a centered modal?
Posted: Fri Feb 11, 2011 12:36 am
by dburdan
Thanks Steve I think I'll try that! My game is about 95% done so far! Can't wait to release it to the appstore! As far as you Klaus, I think we should vote an award or something for you!