Hello,
I’m trying to create a layer on a tilemap programmatically.
I want to create a layer of objects over the background and other info gained by the tilemap.
//use new to test; delete after
//create a new layer for the softblocks
CCTMXLayerInfo \* pSoftblockLayerInfo = new CCTMXLayerInfo();
CCTMXTilesetInfo \* pSoftblockLayerTilesetInfo = new CCTMXTilesetInfo();
CCTMXMapInfo \* pSoftblockLayerMapInfo = new CCTMXMapInfo();
CCTMXLayer \* pSoftblockLayer = CCTMXLayer::create(pSoftblockLayerTilesetInfo, pSoftblockLayerInfo, pSoftblockLayerMapInfo );
I get an error as it cant find the tilemap….anyway round this?
if I try to enter an empty layer in the tiled editor and save it as a tmx. With background layer and an empty “foreground” layer.
I get a crash as it cant create a texture2d for …something? <- Possible bug…
With an empty layer in tiled tmx I get a crash here
bool CCTexture2D::hasPremultipliedAlpha()
{
return m\_bHasPremultipliedAlpha;
}
but still, id like to do it programmatically