cocos2d iphone - Accessing Information on other Layers -


i have 2 layers, game , hudlayer. hud on top of helloworldlayer.

i've got button press reload hudlayer numbers showing on screen capture what's on gameplay.

buttontapped: declared on hudlayer(which goes before helloworldlayer) implementation.

hudlayer , helloworldlayer on same file helloworldlayer.m

i press button and:

    - (void)buttontapped:(id)sender     {         int number = 6;      //heres problem        //i dont know how change part...          [[helloworldlayer]->changednumber = number; ///how give changednumber     number's value?????           _label.string = [nsstring stringwithformat:@"number: %d",number];       } 

helloworldlayer has property:

    @property (assign) int changednumber; 

sounds sender helloworldlayer.

you can try:

sender.changednumber = number; 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -