Say you wanted to do make a button module so that you could instantiate it like the attached image. The button should be made up of three layers: the background, the text, and the hit target. There would also be some event-based animations for the interactive states.
I've been trying to extend the Layer class so I can use the constructor to handle the text. But I am getting hung up on creating the layers, parenting them properly, and handling the events. Am I going down the wrong track by attempting to extend Layer?