How exactly does layer order work? It seems like an easy topic, but I just can't figure this out: Why is "selected" always under "buttons" in this case?
buttons.addSubLayer(share)buttons.addSubLayer(reply)buttons.addSubLayer(action)share.addSubLayer(a.share_icon)reply.addSubLayer(a.reply_icon)action.addSubLayer(a.action_icon)a.share_icon.center()a.share_icon.y = 25a.reply_icon.center()a.reply_icon.y = 5a.action_icon.center()a.action_icon = 5
a.selected.bringToFront()buttons.z = 1action.z = 1a.action_icon.z = 1a.selected.z = 10000
Do root layers never overlap sublayers?
Yup. Sublayers are always on top of super layers. Think of it as a stack of cards, with the root layer being the most back one.
But consider two superlayers (A and B) with sublayers... can't superlayerA ever sit over sublayer of superlayerB?