Difference between revisions of "Object"
From GiderosMobile
(Created page with "__NOTOC__ '''Supported platforms:''' <br/> '''Available since:''' Gideros 2015.08<br/> === Description === Main Object class from which all Gideros classes inherit.<br/> There...") |
|||
(16 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Supported platforms:''' <br/> | + | <languages /> |
− | '''Available since:''' Gideros 2015.08<br/> | + | <!-- GIDEROSOBJ:Object --> |
− | === Description === | + | '''<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/> |
− | Main Object class from which all Gideros classes inherit. | + | '''<translate>Available since</translate>:''' Gideros 2015.08<br/> |
− | There is no other purpose for this | + | |
− | | style="width: 50%;"| | + | === <translate>Description</translate> === |
− | === Methods === | + | Main Object class from which all Gideros classes inherit. |
− | | style="width: 50%;"| | + | |
− | === Events === | + | There is no other purpose for this class, rather a neat way to add methods to all Gideros classes. |
− | === Constants === | + | |
+ | === <translate>Examples</translate> === | ||
+ | <source lang="lua"> | ||
+ | local bmp = Bitmap.new("image.png") | ||
+ | print(bmp:getClass()) -- prints Bitmap | ||
+ | print(bmp:getBaseClass()) -- prints Sprite | ||
+ | print(bmp:isInstanceOf("Bitmap")) -- prints true | ||
+ | print(bmp:isInstanceOf("Sprite")) -- prints true | ||
+ | print(bmp:isInstanceOf("EventDispatcher")) -- prints true | ||
+ | print(bmp:isInstanceOf("Object")) -- prints true | ||
+ | print(bmp:isInstanceOf("TileMap")) -- prints false | ||
+ | </source> | ||
+ | |||
+ | {|- | ||
+ | | style="width: 50%; vertical-align:top;"| | ||
+ | === <translate>Methods</translate> === | ||
+ | [[Special:MyLanguage/Object:getBaseClass|Object:getBaseClass]] ''<translate>returns base class</translate>''<br/><!-- GIDEROSMTD:Object:getBaseClass() returns base class --> | ||
+ | [[Special:MyLanguage/Object:getClass|Object:getClass]] ''<translate>returns class name</translate>''<br/><!-- GIDEROSMTD:Object:getClass() returns class name --> | ||
+ | [[Special:MyLanguage/Object:isInstanceOf|Object:isInstanceOf]] ''<translate>checks if instance belongs to class</translate>''<br/><!-- GIDEROSMTD:Object:isInstanceOf(classname) checks if instance belongs to class --> | ||
+ | |||
+ | | style="width: 50%; vertical-align:top;"| | ||
+ | === <translate>Events</translate> === | ||
+ | === <translate>Constants</translate> === | ||
|} | |} | ||
+ | |||
+ | {{GIDEROS IMPORTANT LINKS}} |
Revision as of 14:59, 30 January 2020
Supported platforms:
Available since: Gideros 2015.08
Description
Main Object class from which all Gideros classes inherit.
There is no other purpose for this class, rather a neat way to add methods to all Gideros classes.
Examples
local bmp = Bitmap.new("image.png")
print(bmp:getClass()) -- prints Bitmap
print(bmp:getBaseClass()) -- prints Sprite
print(bmp:isInstanceOf("Bitmap")) -- prints true
print(bmp:isInstanceOf("Sprite")) -- prints true
print(bmp:isInstanceOf("EventDispatcher")) -- prints true
print(bmp:isInstanceOf("Object")) -- prints true
print(bmp:isInstanceOf("TileMap")) -- prints false
MethodsObject:getBaseClass returns base class |
EventsConstants |