In older version, I used this code.
this code is for custom attachment.
spRegionAttachment * Util::regionWithTexture2d(cocos2d::Texture2D *tex2d, const char *name) {
TextureAtlas *tex = TextureAtlas::createWithTexture(tex2d, 64);
tex->retain();
spAtlasPage *page = spAtlasPage_create(name);
page->rendererObject = tex;
page->width = tex2d->getContentSizeInPixels().width;
page->height = tex2d->getContentSizeInPixels().height;
spAtlasRegion *reg = spAtlasRegion_create();
reg->page = page;
spRegionAttachment *region = spRegionAttachment_create(name);
region->rendererObject = reg;
Size size = tex2d->getContentSizeInPixels();
float u = 0;
float u2 = 1;
float v = 0;
float v2 = 1;
spRegionAttachment_setUVs(region, u, v, u2, v2, 0);
region->regionOffsetX = 0;
region->regionOffsetY = size.height;
region->regionWidth = size.width;
region->regionHeight = size.height;
region->regionOriginalWidth = region->regionWidth;
region->regionOriginalHeight = region->regionHeight;
region->scaleX = 1/CC_CONTENT_SCALE_FACTOR();
region->scaleY = 1/CC_CONTENT_SCALE_FACTOR();
region->rotation = -90;
region->width = size.width;
region->height = size.height;
spRegionAttachment_updateOffset(region);
return region;
}
but spAtlasPage_create is changed. this function is needed more parameter.( spAtlas* atlas, const char* name )
spAtlas??
I can't modify this code.
Help me..