Hoping somebody might be able to offer some advice on the following.
I have a tilemap comprising of three tile layers, which represents the main game environment/world.
In addition I have a display group hierarchy that covers:
The World - I insert MTE in to this group (the above three tile layers) plus sprites/images that are added as the game progresses, i.e players build an item/building.
Maps Display Group - a “heatmap”, visually representing the properties (value, …) of each individual tile.
HUD Display Group - UI elements
I’m creating the HeatMap by creating blocks (display.newRect) and adjusting their colour values dependant upon the property value - essentially it’s just a layer above the game map that clones its structure. I had issues with moving/dragging the camera/map and scaleFactors so decided to add these “blocks” via mte.addSprite and let MTE handle them.
All works as expected, however I’m struggling to organise the various components into the display group hierarchy that I’ve planned. Currently when tggling the heatMap on/off I run through the .numChildren of that particular displayGroup - but if I don’t add them to this I have no way (to my knowledge) of performing this action.
I haven’t experimented much with MTE and different display groups, I’ve noticed mte.setParentGroup() however that doesn’t appear to solve my issue. Essentially I want MTE to have control over the various visual components but at the same time squeeze these into the display groups that I’ve created for organisational purposes.
If I add the “block” into my display group after using addSprite I notice that the heatmap layer won’t move with the map drag/movement - as expected considering it’s out of MTE’s control now I guess.
To be honest I’m struggling to explain the problem I’m facing, but would appreciate if somebody could confirm that MTE works nicely with manually created display groups and perhaps a prod in the right direction.
Many thanks…