ios - Coco2dx - Changing To Background Image -


i need someone's help. have no idea replace custom background image. i'm can't anymore.

    -(id) init {     // call "super" init     // apple recommends re-assign "self" "super's" return value     if( (self=[super initwithcolor:ccc4(219,31,94, 999)]) ) {         ws=[[ccdirector shareddirector]winsize];         nsstring *soundfilepath = [[nsbundle mainbundle] pathforresource:@"game" oftype:@"wav"];         nsurl *soundfileurl = [nsurl fileurlwithpath:soundfilepath];         avaudioplayer *player = [[avaudioplayer alloc] initwithcontentsofurl:soundfileurl error:nil];         player.numberofloops=-1;         [player play]; 

create , add ccsprite:

ccsprite *bg = [ccsprite spritewithfile:@"bg.png"]; bg.tag = 1; bg.anchorpoint = cgpointmake(0, 0); [self addchild:bg]; 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -