A question about #Module & #CoffeeScript.Is it possible to add a custom properties for Layer?Thanks!
Subclassing is an option.
layerA.style = border: "5px solid red"
Fardin Shikhiyev it is CoffeeScript, influenced a lot by Python
The best path is the custom property that was just added.
foo = new Layer width: 10, custom: bar: 400, bat: 42
So in your example...
layerA = new Layer x: 100 custom: border: "5px solid red"
That's using the new custom property that gets tracked in the class constructor.
Works with .copy() too.
Is there documentation for layer.custom yet?
No. I don't think they are planning on pushing it out publicly. It think they will just be recommending it if people ask.
It looks like Black Ray is expecting this to actually change the border, which the new 'custom' property wont' do. The custom property is just for storing data to use later. If you want to actually set a CSS Style like border, you need to do it in a separate call, as Irwansyah mentioned above: layer.style = border: "5px solid red"
WOW! That's an undocumented feature, like we just found a hidden gem!
Jordan Robert Dobson Mike Feldstein Irwansyah
im pretty unclear what you're trying to do there. You can wrap everything in the 'custom' property (http://share.framerjs.com/px5ndqqtol5z/), but all those things look like they're trying to be functional. Are you just trying to store these properties for later in a non-functional way?
You can take out @define function located at BaseClass and modify that function to accept a class so that you can add a property on Layer class and then you can pass the value of that property on the options. Is that you want?
It works for me like this