Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot link member variables from CocosBuilder #52

Open
codynguyen opened this issue Sep 18, 2013 · 4 comments
Open

Cannot link member variables from CocosBuilder #52

codynguyen opened this issue Sep 18, 2013 · 4 comments

Comments

@codynguyen
Copy link

Hi,

I'm working on a project with CocosBuilder integration. Code connection from a CCBI file to a ruby class is OK.
The only problem is CCBReader cannot link variable from CCBI files to the ruby class: CCBReader: Couldn't find member variable: nodeCredit

The code that failed

class HomeLayer < Joybox::Core::Layer
  attr_accessor :nodeCredit

  # The below callback is OK
  def didLoadFromCCB
    load_audio
  end
end

I suspect the problem comes from how CCBReader retrieve Ivar from another class: Ivar ivar = class_getInstanceVariable([target class],[memberVarAssignmentName UTF8String]);. Below is the suspected code:

      if (memberVarAssignmentType)
        {
            id target = NULL;
            if (memberVarAssignmentType == kCCBTargetTypeDocumentRoot) target = actionManager.rootNode;
            else if (memberVarAssignmentType == kCCBTargetTypeOwner) target = owner;

            if (target)
            {
                Ivar ivar = class_getInstanceVariable([target class],[memberVarAssignmentName UTF8String]);
                NSLOG("class: %@", [target class]);
                if (ivar)
                {
                    object_setIvar(target,ivar,node);
                }
                else
                {
                    NSLog(@"CCBReader: Couldn't find member variable: %@", memberVarAssignmentName);
                }
            }
        }

Kindly help with this. Thanks!

@NSCoder
Copy link
Contributor

NSCoder commented Sep 18, 2013

Hey Cody,

We haven't test the CocosBuilder yet, but its a good time to do it. Give me some time I will check it out.

Best,

JK

@codynguyen
Copy link
Author

Thanks JK, I really appreciate it 👍

@NSCoder
Copy link
Contributor

NSCoder commented Nov 12, 2013

A quick update Cody!

We are working in support for CocosBuilder :)

@codynguyen
Copy link
Author

Great! thanks for the update Juan.


Cody Nguyen
Lead Web Consultant
Vinova Pte. Ltd | vinova.sg (http://www.vinova.sg)

On Tuesday, November 12, 2013 at 11:06 AM, Juan Jose Karam wrote:

A quick update Cody!
We are working in support for CocosBuilder :)


Reply to this email directly or view it on GitHub (#52 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants