Difference between revisions of "Object"
From GiderosMobile
(remove language stuff) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
=== Examples === | === Examples === | ||
− | < | + | <syntaxhighlight lang="lua"> |
local bmp = Bitmap.new("image.png") | local bmp = Bitmap.new("image.png") | ||
print(bmp:getClass()) -- prints Bitmap | print(bmp:getClass()) -- prints Bitmap | ||
Line 19: | Line 19: | ||
print(bmp:isInstanceOf("Object")) -- prints true | print(bmp:isInstanceOf("Object")) -- prints true | ||
print(bmp:isInstanceOf("TileMap")) -- prints false | print(bmp:isInstanceOf("TileMap")) -- prints false | ||
− | </ | + | </syntaxhighlight> |
{|- | {|- |
Latest revision as of 14:32, 13 July 2023
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 |