FixedPriority vs SceneGraphPriority

The EventDispatcher uses priorities to decide which listeners get delivered an event first.

Fixed Priority is an integer value. Event listeners with lower Priority values get to process events before event listeners with higher Priority values.

Scene Graph Priority is a pointer to a Node. Event listeners whose Nodes have higher z-order values (that is, are drawn on top) receive events before event listeners whose Nodes have lower z-order values (that is, are drawn below). This ensures that touch events, for example, get delivered front-to-back, as you would expect.

Remember the Basic Concepts chapter? Where we talked about the scene graph and we talked about this diagram?

Well, when use Scene Graph Priority you are actually walking this above tree backwards... I, H, G, F, E, D, C, B, A. If an event is triggered, H would take a look and either swallow it (more on this below) or let is pass through to I. Same thing, I will either consume it or let is pass through to G and so on until the event eitherswallowed_ it or does not get answered.

results matching ""

    No results matching ""