rolandoam/shinycocos

where can we submit implementations of the missing functionality?

Closed this issue · 1 comments

Hey bud,

First of all, this is a fantastic project :) in just a few days I've almost completed a working app.. Great job :D

However, in order to implement my app, I've had to extend the bindings to cover some missing functionality..

My question: where is the best place to submit these alterations for review?

I new to the whole github thing, so sorry if I've overlooked something..

For the time being, here's some code that might be useful to others..

Implementation of BezierBy action for SC_Action.m

VALUE rb_cBezierBy_s_new(int argc, VALUE *argv, VALUE klass) {

CHECK_ARGS_NUM(5)
Check_Type(argv[1], T_ARRAY);
Check_Type(argv[2], T_ARRAY);
Check_Type(argv[3], T_ARRAY);
Check_Type(argv[4], T_ARRAY);

ccBezierConfig config;
config.startPosition    = cpv(NUM2DBL(RARRAY_PTR(argv[1])[0]), NUM2DBL(RARRAY_PTR(argv[1])[1]));
config.controlPoint_1   = cpv(NUM2DBL(RARRAY_PTR(argv[2])[0]), NUM2DBL(RARRAY_PTR(argv[2])[1]));
config.controlPoint_2   = cpv(NUM2DBL(RARRAY_PTR(argv[3])[0]), NUM2DBL(RARRAY_PTR(argv[3])[1]));
config.endPosition      = cpv(NUM2DBL(RARRAY_PTR(argv[4])[0]), NUM2DBL(RARRAY_PTR(argv[4])[1]));

BezierBy *action = [[BezierBy alloc] initWithDuration: NUM2DBL(argv[0]) bezier: config];
VALUE ret = sc_init(klass, nil, action, argc-5, argv+5, YES);
return ret;

}

Implementation of method to set the z-order of a node

/*

  • call-seq:
  • node.z_order = 4
  • Sets the z order of the sprite
    */
    VALUE rb_cCocosNode_set_z_order(VALUE object, VALUE z) {
    [CC_NODE(object).parent reorderChild: CC_NODE(object) z: FIX2INT(z)];
    return z;
    }

Functionality to stop all actions running on a node

(line 760ish)
rb_define_method(rb_cCocosNode, "stop_actions", rb_cCocosNode_stop_actions, 0);

/*

  • node.stop_actions() #=> nil

*/
VALUE rb_cCocosNode_stop_actions(VALUE object) {
[CC_NODE(object) stopAllActions];

return object;
}

Cheers, I'll submit more later if it's useful?

hey johnbeaven, nice work! There are two paths: I can make you a contributor to the project, you create a local branch and then commit the changes to the master branch, or you can fork the project work on your own version and then we pull form your work. I would prefer to make you a collaborator, so I already did that :-)
git clone with your private url, apply changes in that repo and then feel free to push them to master.
If you have questions about how to use github/git, check the http://github.com/guides, they're really helpful.
If you have more questions, feel free to ask me, but please send me a PM or just email me directly :-)
cheers,
rolando.