t2dTileLayer class namespace question
by Aaron Miller · in Torque Game Builder · 03/07/2009 (9:52 pm) · 0 replies
Hello all. This is more of a style/usage question than a technical problem as my script works but I'm not sure if it's proper.
I've created a tile layer dynamically in script using createTileLayer and wanted to link it to a class namespace so that I could use the tile layer's onCollision method. However, I was only able to get it working using t2dTileLayer::onCollision, which feels like a hack. Is this right?
I tried setting the namespace using setClassNamespace, but that failed. I had no luck with the docs/TDN, and a forum search seems to hint that you're supposed to use addTileLayer if you want class namespace linkage, but if so you must specify a layer file.
I *think* (by looking through source) that the problem is that the layer is added to the tile map internally and possibly not meant to have a namespace because the tile map already has one. But the tile map doesn't have callbacks that the layer has, so I'm wondering what the rationale here is.
Thanks for any help!
I've created a tile layer dynamically in script using createTileLayer and wanted to link it to a class namespace so that I could use the tile layer's onCollision method. However, I was only able to get it working using t2dTileLayer::onCollision, which feels like a hack. Is this right?
I tried setting the namespace using setClassNamespace, but that failed. I had no luck with the docs/TDN, and a forum search seems to hint that you're supposed to use addTileLayer if you want class namespace linkage, but if so you must specify a layer file.
I *think* (by looking through source) that the problem is that the layer is added to the tile map internally and possibly not meant to have a namespace because the tile map already has one. But the tile map doesn't have callbacks that the layer has, so I'm wondering what the rationale here is.
Thanks for any help!