Update symbol table in the gotoScene
When we switch from one scene to the other one, we will hide some groups and show others. The symbol table of a sprite is built accoridng to the mbname of each groups in the system. This will introduce some confliction. For example,
<g id="Layer1">
<g id="scene1">
<g id="g1234" mbname="light" />
</g>
<g id="scene2">
<g id="g1235" mbname="light" />
</g>
</g>
The "light" exists in both scene1 and scene2. However, they are different object in a SVG file. When we switch from scene1 to scene 2, we can not simplily hide scene1 and show scene2. We need to rebuild the symbol table to switch light from g1234 to g1235. This means that we need to delete all symbols from scene1 and insert all symbols from scene2.
We need to collect the list of symbol names from each scene, the insert/delete need to be done.
<g id="Layer1">
<g id="scene1">
<g id="g1234" mbname="light" />
</g>
<g id="scene2">
<g id="g1235" mbname="light" />
</g>
</g>
The "light" exists in both scene1 and scene2. However, they are different object in a SVG file. When we switch from scene1 to scene 2, we can not simplily hide scene1 and show scene2. We need to rebuild the symbol table to switch light from g1234 to g1235. This means that we need to delete all symbols from scene1 and insert all symbols from scene2.
We need to collect the list of symbol names from each scene, the insert/delete need to be done.
Leave a comment