Extending the Layer class?
Assume that I want an object that consists of an outer layer which is the parent of multiple other layers. I want this object to respond to events (click, resize) as well as store values, so making it a class seems like a good idea.
My class currently looks roughly like this:
This works fine, but when I want to - say - make an instance of this class be the child of another layer, I have to do this:
...when I really want to say:
Or if I want its size, I have to say o.outerLayer.size rather than o.size, etc.
To make this work how I want it to work, I'm assuming I need my class to extend the Layer class, and have the instance itself assume the role of this outerLayer hack that I've put in. But Google has failed me in this regard.
With those intentions in mind, what would my class above look like as a subclass of Layer? Or is there another way of achieving the same thing?