Difference between revisions of "Object:typeOf (Español)"

(Created page with "Comprueba si un objeto es de un tipo determinado. Si el objeto tiene el tipo con el nombre especificado en su jerarquía, esta función devolverá true. == Function == === Synop...")
(No difference)

Revision as of 03:10, 26 June 2011

Comprueba si un objeto es de un tipo determinado. Si el objeto tiene el tipo con el nombre especificado en su jerarquía, esta función devolverá true.

Function

Synopsis

b = Object:typeOf( name )

Arguments

string name
El nombre del tipo de comprobar.

Returns

boolean b
True si el objeto es del tipo especificado, False en contrario.

Examples

Comprobar el tipo de un objeto

image = love.graphics.newImage("test.png")
print(image:typeOf("Object")) -- outputs: true
print(image:typeOf("Drawable")) -- outputs: true
print(image:typeOf("Image")) -- outputs: true
print(image:typeOf("MouseJoint")) -- outputs: false

See Also

Other Languages