Difference between revisions of "Screen"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
 
 
<!-- GIDEROSOBJ:Screen -->
 
<!-- GIDEROSOBJ:Screen -->
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
+
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
'''<translate>Available since</translate>:''' Gideros 2017.8<br/>
+
'''Available since:''' Gideros 2017.8<br/>
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
+
'''Inherits from:''' [[Object]]<br/>
=== <translate>Description</translate> ===
+
 
<translate>Screen class allows to access secondary displays or windows.</translate>
+
=== Description ===
 +
The '''Screen''' class allows to access secondary displays or windows.
 +
 
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
local s = Sprite.new()
 +
local img = Bitmap.new(Texture.new("gfx/ui/rpgpp_lt_models_vgood.png"))
 +
s:addChild(img)
 +
 
 +
local ss = Screen.new(0)
 +
ss:setPosition(128, 128)
 +
ss:setSize(256, 256)
 +
ss:setTitle("my screen")
 +
ss:setState(Screen.STATE_NORMAL | Screen.STATE_ACTIVE)
 +
ss:setContent(s)
 +
</syntaxhighlight>
 +
 
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Methods</translate> ===
+
=== Methods ===
[[Special:MyLanguage/Screen.new|Screen.new]] ''<translate>Open a new screen</translate>''<br/><!-- GIDEROSMTD:Screen.new -->
+
[[Screen.new]] ''opens a new screen''<br/><!--GIDEROSMTD:Screen.new(id) opens a new screen-->
[[Special:MyLanguage/Screen:clear|Screen:clear]] ''<translate>Sets the background color of this screen</translate>''<br/><!-- GIDEROSMTD:Screen:clear -->
+
[[Screen:clear]] ''sets the screen background color''<br/><!--GIDEROSMTD:Screen:clear(color,alpha) sets the screen background color-->
[[Special:MyLanguage/Screen:getId|Screen:getId]] ''<translate>Returns the screen's id</translate>''<br/><!-- GIDEROSMTD:Screen:getId -->
+
[[Screen:getId]] ''returns the screen id''<br/><!--GIDEROSMTD:Screen:getId() returns the screen id-->
[[Special:MyLanguage/Screen:getMaxSize|Screen:getMaxSize]] ''<translate>Returns the maximum size this screen can have</translate>''<br/><!-- GIDEROSMTD:Screen:getMaxSize -->
+
[[Screen:getMaxSize]] ''returns the maximum size the screen can have''<br/><!--GIDEROSMTD:Screen:getMaxSize() returns the maximum size the screen can have-->
[[Special:MyLanguage/Screen:getPosition|Screen:getPosition]] ''<translate>Returns the position of this screen</translate>''<br/><!-- GIDEROSMTD:Screen:getPosition -->
+
[[Screen:getPosition]] ''returns the screen position''<br/><!--GIDEROSMTD:Screen:getPosition() returns the screen position-->
[[Special:MyLanguage/Screen:getSize|Screen:getSize]] ''<translate>Returns the size of this screen</translate>''<br/><!-- GIDEROSMTD:Screen:getSize -->
+
[[Screen:getSize]] ''returns the screen size''<br/><!--GIDEROSMTD:Screen:getSize() returns the screen size-->
[[Special:MyLanguage/Screen:getState|Screen:getState]] ''<translate>Returns the state of this screen</translate>''<br/><!-- GIDEROSMTD:Screen:getState -->
+
[[Screen:getState]] ''returns the screen state''<br/><!--GIDEROSMTD:Screen:getState() returns the screen state-->
[[Special:MyLanguage/Screen:setContent|Screen:setContent]] <br/><!-- GIDEROSMTD:Screen:setContent -->
+
[[Screen:setContent]] ''sets the screen content''<br/><!--GIDEROSMTD:Screen:setContent(content) sets the screen content-->
[[Special:MyLanguage/Screen:setPosition|Screen:setPosition]] ''<translate>Sets the position of this screen, if possible.</translate>''<br/><!-- GIDEROSMTD:Screen:setPosition -->
+
[[Screen:setPosition]] ''sets the screen position (when possible)''<br/><!-- GIDEROSMTD:Screen:setPosition(x,y) sets the screen position (when possible)-->
[[Special:MyLanguage/Screen:setSize|Screen:setSize]] ''<translate>Sets the size of this screen, if possible.</translate>''<br/><!-- GIDEROSMTD:Screen:setSize -->
+
[[Screen:setSize]] ''sets the screen size (when possible)''<br/><!-- GIDEROSMTD:Screen:setSize(w,h) sets the screen size (when possible)-->
[[Special:MyLanguage/Screen:setState|Screen:setState]] ''<translate>Sets the state of this screen, if possible.</translate>''<br/><!-- GIDEROSMTD:Screen:setState -->
+
[[Screen:setState]] ''sets the screen state (when possible)''<br/><!-- GIDEROSMTD:Screen:setState(state) sets the screen state (when possible)-->
 +
[[Screen:setTitle]] ''sets the screen title''<br/><!-- GIDEROSMTD:Screen:setTitle(title) sets the screen title-->
 +
 
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Events</translate> ===
+
=== Events ===
=== <translate>Constants</translate> ===
+
=== Constants ===
 
|}
 
|}
 +
 +
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 14:32, 13 July 2023

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2017.8
Inherits from: Object

Description

The Screen class allows to access secondary displays or windows.

Example

local s = Sprite.new()
local img = Bitmap.new(Texture.new("gfx/ui/rpgpp_lt_models_vgood.png"))
s:addChild(img)

local ss = Screen.new(0)
ss:setPosition(128, 128)
ss:setSize(256, 256)
ss:setTitle("my screen")
ss:setState(Screen.STATE_NORMAL | Screen.STATE_ACTIVE)
ss:setContent(s)

Methods

Screen.new opens a new screen
Screen:clear sets the screen background color
Screen:getId returns the screen id
Screen:getMaxSize returns the maximum size the screen can have
Screen:getPosition returns the screen position
Screen:getSize returns the screen size
Screen:getState returns the screen state
Screen:setContent sets the screen content
Screen:setPosition sets the screen position (when possible)
Screen:setSize sets the screen size (when possible)
Screen:setState sets the screen state (when possible)
Screen:setTitle sets the screen title

Events

Constants