Page 1 of 1

GetObjectType usage

Posted: Mon Oct 28, 2019 8:22 pm
by sashapont
Please explain me how I can use this function

TextOut(10, 10,"a" ,{name= text1,Color=#Black})

how I can get type of this object?

type = GetObjectType("text1")

is not work...

Re: GetObjectType usage

Posted: Tue Oct 29, 2019 1:01 am
by PEB
There is no reason to use GetObjectType() at all with your example.

The purpose of GetObjectType() is to return the type of object that is associated with a custom #LIGHTUSERDATA identifier (created by using Hollywood's Automatic ID selection).

In your example, you are assigning a layer name (which always needs to be a string). Layers are the only objects that can have #STRING names. So if you use your example:
TextOut(10, 10,"a", {name="text1", Color=#Black})

...you now have a layer with the name "text1".

If you want to know what type of layer "text1" is, then GetAttribute(#LAYER, "text1", #ATTRTYPE) will give you that information.