[10 Jan 2010] #LIGHTUSERDATA, rename layer

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

[10 Jan 2010] #LIGHTUSERDATA, rename layer

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 10 Jan 2010 12:00:34 +0100

Hi!

I learned that the automatic id creation creates id types #LIGHTUSERDATA. SetLayerName() can accept #NUMBER for the first parameter. So, how can I rename a layer that created with auto id?
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[10 Jan 2010] Re: #LIGHTUSERDATA, rename layer

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 10 Jan 2010 22:24:26 +0100
Hi!

I learned that the automatic id creation creates id types #LIGHTUSERDATA. SetLayerName() can accept #NUMBER for the first parameter. So, how can I rename a layer that created with auto id?
Um, why is everyone suddenly doing the layer stuff wrong? :) There is no auto id creation for layers at all... you can't do things like:

Code: Select all

; BAD CODE!
EnableLayers
new_layer = DisplayBrush(1, 0, 0)
This won't work. The only thing you can do now is convenient assignment of a name to a layer, e.g.

Code: Select all

; GOOD CODE!
DisplayBrush(1, 0, 0, {Name = "mylayer"})
This will automatically insert the brush under the name "mylayer". You no longer have to hassle with ids if you do it this way.
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

[10 Jan 2010] Re: #LIGHTUSERDATA, rename layer

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 10 Jan 2010 23:42:16 +0100

Hello Andreas

Ok, so the new syntax let me change:

Code: Select all

InsertLayer(0,#ANIM,id, x, y, True)
SetLayerName(0,"hal")       
to just this:

Code: Select all

DisplayAnimFrame(id, x, y,1,{hidden=True, name="hal"}) 
That's great. Thanks to clarify that.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[11 Jan 2010] Re: Re: #LIGHTUSERDATA, rename layer

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 11 Jan 2010 12:10:41 +0100
Hello Andreas

Ok, so the new syntax let me change:

InsertLayer(0,#ANIM,id, x, y, True) SetLayerName(0,"hal")

to just this:

DisplayAnimFrame(id, x, y,1,{hidden=True, name="hal"})
Yep, exactly. You can even specify the insert position using the "InsertPos" tag. You can work entirely without using any hardcoded layer IDs. You can just work with names.
Locked