Hey all,
Got something really weird going on… in the Gentrieve 2 map system, I make small transparent boxes for each room. If a room is a “special” room, like a Save Room, or Starting Room, I want a small label to be placed in the center of the room. I got this working when I was drawing the entire map all the time – all of my labels showed up OK. However, when I reduced the map to only discovered areas, I noticed some of my labels were not showing up properly. In this picture, the room with the green arrow (the room the player is in), should have a Save Room label:
You can see the “Starting Room” label renders fine. Here is the code for adding labels to rooms:
[java] // make some kinda label in this room?
String useTexture = null;
if( forRoom.BossAbility != null ) {
useTexture = “Textures/bossroom.png”;
} else if( forRoom.SpecialType != null ) {
if( forRoom.SpecialType.startsWith(“SecretRoom”) ) {
useTexture = “Textures/itemroom.png”;
} else {
useTexture = “Textures/itm” + forRoom.SpecialType.toLowerCase() + “.png”; // useTexture gets set to “Textures/itmsaveroom.png” here
}
} else if( forRoom.roomsFromStart == 0 ) {
useTexture = “Textures/startroom.png”;
}
if( useTexture != null ) {
Geometry roomlabel = new Geometry(“map_label”, Main.SimpleQuad);
Material mat = new Material(Main.GApp.getAssetManager(), “Common/MatDefs/Misc/Unshaded.j3md”);
//((DesktopAssetManager)Main.GApp.getAssetManager()).clearCache();
mat.setTexture(“ColorMap”, Main.GApp.getAssetManager().loadTexture(useTexture));
roomlabel.addControl(new BillboardControl());
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
mat.getAdditionalRenderState().setDepthWrite(false);
roomlabel.setQueueBucket(Bucket.Transparent);
roomlabel.setMaterial(mat);
roomlabel.setLocalTranslation(forRoom.GetSizeX()ROOM_SCALE0.5f,
forRoom.GetSizeY()ROOM_SCALE0.5f,
forRoom.GetSizeZ()ROOM_SCALE0.5f);
BaseNode.attachChild(roomlabel);
}
[/java]
If I un-comment out the getAssetManager().clearCache() line, this happens (which is what it is suppose to look like):
http://i.imgur.com/7jCHh.png
I thought of trying the clearCache() because when stepping through the program, I saw it getting “Textures/itmsaveroom.png” from some smartcache. However, I’m pretty sure this is the first place I try and load itmsaveroom.png, so I wasn’t sure at what point it was caching it from… when the cache is cleared, the texture is not in the cache, and the Save Room label displays OK.
Any ideas? Any help would be appreciated… I don’t want to clear the whole cache if I don’t need to

P.S. I’ve also tried attaching my map system to the built-in rootNode, to see if it was at all related, but this same behavior still happens (just incase you’ve read my other threads, hehe).