[26 Jan 2010] GetAttribute(#DISPLAY,1,#ATTRLAYERS) -> always 0?

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[26 Jan 2010] GetAttribute(#DISPLAY,1,#ATTRLAYERS) -> always 0?

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 26 Jan 2010 11:14:01 -0000

Since HW4.5,

GetAttribute(#DISPLAY,1,#ATTRLAYERS)

returns 0.

For example:

I have two TextObjects, layers are enabled and now I want to do the following:

Code: Select all

Local numlay = GetAttribute(#DISPLAY,1,#ATTRLAYERS)
DisplayTextObject(1,100,100)
SetLayerName(numlay+1,"text1")
DisplayTextObject(2,150,100)
SetLayerName(numlay+2,"text2")

Debugprint("id of text1: "..GetAttribut(#LAYER,"text1",#ATTRLAYERID))
Debugprint("id of text2: "..GetAttribut(#LAYER,"text2",#ATTRLAYERID))
Debugprint("number of layers: "..GetAttribute(#DISPLAY,1,#ATTRLAYERS))
Output is then:

Code: Select all

id of text1: 1
id of text2: 2
number of layers: 0
You see, that text1 and text2 have an layer-ID, but "GetAttribute()" returns always 0? Why is that the case and what has changed here in HW4.5 compared to HW4.0? The documentation didn't help me so far :-(

Thanks, Tom
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[27 Jan 2010] Re: GetAttribute(#DISPLAY,1,#ATTRLAYERS) -> always 0?

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 27 Jan 2010 14:09:51 -0000

To answer myself because nobody has seemed to know ..

I found out what the problem is.
From HW4.0 to HW4.5 has changed that the GetAttribute(#DISPLAY,1,#ATTRLAYERS) only returns a value different from zero, if DisplayBGPic(1) has been called already.
Whereas GetAttribut(#LAYER,"text1",#ATTRLAYERID)) returns the layerid already before that command.

That means, you cannot give layer names to TextObjects anymore, before they have already been drawn on screen.

So, creating several TextObjects on a BGPic and showing them at once with the BGPic is not possible anymore if you want to assign/remember a layer name for each layer because GetAttribut() doesn't give you the number of layers already attached to the BGPic/Display?

Took me 2 days so far to just get my script start on HW4.5 and I'm still not yet sure if it works as before. That's the reason why I had prefered to have also a "just" a bug release for HW4.0 :-)

regards, Tom
Locked