Tuesday 26 June 2012

How to make a full screen app

Sometime you want to full the screen: with an image, a text, or an application. Creating a full screen application with Rebol is extremely easy:
First of all you need to know the screen size, by using the system/view/screen-face/size variable:

>> system/view/screen-face/size
== 1280x1024


and the center-face function:


>> myapp: layout/size [ button "Close" [unview] ] system/view/screen-face/size
>> center-face myapp
>> view myapp


Here the result:
You can do more, you can center also the button:

>> myapp: layout/size [ a: button "Close" [unview] ] system/view/screen-face/size
>> center-face a
>> center-face myapp
>> view myapp

Here the result:
Ok, this was just a super simple small example. Why don't you add a background image? Some funny color or gradient?
Post your ideas in the comments below! I'll post yor result in the next posts. :-)

No comments:

Post a Comment