Difference between revisions of "Object"

From GiderosMobile
Line 16: Line 16:
 
print(bmp:isInstanceOf("TileMap")) -- prints false</source>
 
print(bmp:isInstanceOf("TileMap")) -- prints false</source>
 
{|-
 
{|-
| style="width: 50%;"|
+
| style="width: 50%; vertical-align:top;"|
 
=== Methods ===
 
=== Methods ===
[[Object:getBaseClass]] {{<translate>returns base class</translate>}}<br/>
+
[[Object:getBaseClass]] ''<translate>returns base class</translate>''<br/>
[[Object:getClass]] {{<translate>returns class name</translate>}}<br/>
+
[[Object:getClass]] ''<translate>returns class name</translate>''<br/>
[[Object:isInstanceOf]] {{<translate>checks if instance belongs to class</translate>}}<br/>
+
[[Object:isInstanceOf]] ''<translate>checks if instance belongs to class</translate>''<br/>
| style="width: 50%;"|
+
| style="width: 50%; vertical-align:top;"|
 
=== Events ===
 
=== Events ===
 
=== Constants ===
 
=== Constants ===
 
|}
 
|}

Revision as of 14:30, 23 August 2018

Supported platforms:
Available since: Gideros 2015.08

Description

Main Object class from which all Gideros classes inherit.
There is no other purpose for this classes, rather a neat way to add methods to all Gideros classes

Examples

Example usage

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

Methods

Object:getBaseClass returns base class
Object:getClass returns class name
Object:isInstanceOf checks if instance belongs to class

Events

Constants