Can I center my UI in a full screen?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DirkArnold
Posts: 15
Joined: Sat May 14, 2011 11:35 pm

Can I center my UI in a full screen?

Post by DirkArnold » Wed Jun 01, 2011 8:00 am

Hello. I've been searching the forums and haven't quite found the answer to this one (that I'm 8 days out from the end of my trial and this is my first post speaks well of the forum content!)

I'd like to create a 1024 x 768 Mac/Windows (and maybe one day iPad) program that will sit in the middle of a blank screen of that size or larger. What I did find:
-- Backdrop is close, but leaves the dock/taskbar visible.
-- Fullscreen puts everything in the upper left no matter what I try to do otherwise.
-- The OSX LibKiosk external sounds appealing, but what about Windows? (Launching a revlet in IE in kiosk mode is a bit much of a workaround.)

Coming from the Flash/Director world, I'm inclined toward taking over the desktop, but LiveCode is encouraging me think about a more traditional UI solution... that is, work with the OS rather than try to hide it. But before I take that plunge, I thought I'd toss the question out there: Is there a way to center a fixed-size stack in a full-screen application?

Thanks! --Dirk

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can I center my UI in a full screen?

Post by Klaus » Wed Jun 01, 2011 11:35 am

Hi Dirk,

some hints:
1. Use these lines along with a backdrop:
...
set the backdrop to 0,0,0
hide menubar
hide taskbar
## Both commands can be used together on both platforms withpout problemes!
...

And later:
...
set backdrop to none
show menubar
show taskbar
...

2. Yep, fullscreen oly resizes the stack to fullscreen, everything else is left to the developer, bug fun :D
In that case you could GROUP the complete content of your stack/card(s) and:
...
set the loc of grp "everything in it" to the loc of this card
## Et voila fullscreen and centered
...

3. Sorry, no idea about Windows externals for KIOSK mode.


Best

Klaus

DirkArnold
Posts: 15
Joined: Sat May 14, 2011 11:35 pm

Re: Can I center my UI in a full screen?

Post by DirkArnold » Thu Jun 02, 2011 7:31 am

Looks like hide menubar and hide taskbar will do to the trick. Silly me, I took the documentation to mean I'd get halfway there in either Windows or Mac OS, not that by using those together I'd get just what I was looking for.

I'm finding that in LiveCode the correct solution is often the easiest one... Now that's a paradigm shift!

Thanks!

Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

Re: Can I center my UI in a full screen?

Post by Tomka » Thu Jun 02, 2011 9:22 am

Hi Dirk,

some weeks ago i toke a little different way than klaus.

1. created a second substack with the backgroundcolor i wanted for my application... (in my case: black)
2. if I push the fullscreen-button following will happens:

the aplication-stackwindow will centered on screen,
the style of this stack will be set to palette,
the decorations of the apllicationstack will be remove,
the black substack will be opened and set to fullscreen...

Code: Select all

on mouseUp
   set the loc of this stack to the screenLoc
   set style of this stack to palette
   set the decorations of this stack to empty
   go stack "Substacks/Hintergrund_Fullscreen.livecode"    //opens the black substack "Hintergrund"
   set fullscreen of the stack "Hintergrund" to true
end mouseUp
a second button set all back to "windowmode"... works well on windows... mac osx i didnt check

Post Reply