GetObjectType usage

Discuss any general programming issues here
Post Reply
Posts: 143
Joined: Thu Aug 03, 2017 2:49 pm

GetObjectType usage

Post 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...

Posts: 522
Joined: Sun Feb 21, 2010 1:28 am

Re: GetObjectType usage

Post 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}) 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.

Post Reply