• <legend id='Z98Zu'><style id='Z98Zu'><dir id='Z98Zu'><q id='Z98Zu'></q></dir></style></legend>

    <small id='Z98Zu'></small><noframes id='Z98Zu'>

      <i id='Z98Zu'><tr id='Z98Zu'><dt id='Z98Zu'><q id='Z98Zu'><span id='Z98Zu'><b id='Z98Zu'><form id='Z98Zu'><ins id='Z98Zu'></ins><ul id='Z98Zu'></ul><sub id='Z98Zu'></sub></form><legend id='Z98Zu'></legend><bdo id='Z98Zu'><pre id='Z98Zu'><center id='Z98Zu'></center></pre></bdo></b><th id='Z98Zu'></th></span></q></dt></tr></i><div id='Z98Zu'><tfoot id='Z98Zu'></tfoot><dl id='Z98Zu'><fieldset id='Z98Zu'></fieldset></dl></div>
        <bdo id='Z98Zu'></bdo><ul id='Z98Zu'></ul>

      1. <tfoot id='Z98Zu'></tfoot>

        Cocos2d 2.x:理解 ccBezierConfig 行为

        Cocos2d 2.x: understanding ccBezierConfig beheaviour(Cocos2d 2.x:理解 ccBezierConfig 行为)

        <small id='zAIwD'></small><noframes id='zAIwD'>

        <legend id='zAIwD'><style id='zAIwD'><dir id='zAIwD'><q id='zAIwD'></q></dir></style></legend>
          <bdo id='zAIwD'></bdo><ul id='zAIwD'></ul>
          <tfoot id='zAIwD'></tfoot>
            <tbody id='zAIwD'></tbody>
          <i id='zAIwD'><tr id='zAIwD'><dt id='zAIwD'><q id='zAIwD'><span id='zAIwD'><b id='zAIwD'><form id='zAIwD'><ins id='zAIwD'></ins><ul id='zAIwD'></ul><sub id='zAIwD'></sub></form><legend id='zAIwD'></legend><bdo id='zAIwD'><pre id='zAIwD'><center id='zAIwD'></center></pre></bdo></b><th id='zAIwD'></th></span></q></dt></tr></i><div id='zAIwD'><tfoot id='zAIwD'></tfoot><dl id='zAIwD'><fieldset id='zAIwD'></fieldset></dl></div>

                • 本文介绍了Cocos2d 2.x:理解 ccBezierConfig 行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我很久以前就问过一个 然后做从头到尾对称但颠倒"的东西.

                  关于我做错了什么有什么建议吗?

                   ccBezierConfig 贝塞尔曲线;self.position = CGPointMake(0.0f, 150.0f);bezier.controlPoint_1 = CGPointMake(-20.0f, 290.0f);bezier.controlPoint_2 = CGPointMake(260, 290.0f);bezier.endPosition =CGPointMake(340.0f,150.0f);id bezierForward = [CCBezierBy actionWithDuration:3 bezier:bezier];ccBezierConfig bezier2;bezier2.controlPoint_1 = CGPointMake(340.0f, 10.0f);bezier2.controlPoint_2 = CGPointMake(80, 10.0f);bezier2.endPosition =CGPointMake(-20.0f,150.0f);id bezierReturn = [CCBezierBy actionWithDuration:3 bezier:bezier2];[self runAction:[CCSequence 动作:bezierForward, bezierReturn, [CCHide 动作],零]];

                  解决方案

                  我使用的是 CCBezierBy,但示例基于 CCBezierTo 公式.因此,如果我使用 CCBezierTo 代替 CCBezierBy,一切都会按预期工作.

                  I am on this since a while and time ago I asked a question and a user kindly replied to me explaning that there is this plugin tool that I can use to create quick bezier curves prototypes.

                  I tried and produced this:

                  I thought it would be perfectly translated in this ccBezierConfig:

                  ccBezierConfig bezier;
                  self.position = CGPointMake(-10.0f, 400.0f);
                  bezier.controlPoint_1 = CGPointMake(160, 190.0f);
                  bezier.controlPoint_2 = CGPointMake(200, 190.0f);
                  bezier.endPosition =CGPointMake(340.0f,280.0f);
                  
                  id bezierForward = [CCBezierBy actionWithDuration:3 bezier:bezier];    
                  [self runAction: [CCSequence actions:
                                    bezierForward, [CCHide action],
                                    nil]];
                  

                  Unfortunately the path I get is not quiet what I was expecting. The character starts to move from the top left corner of the screen and then just goes up and I don't see the movement I expected.

                  Any explanation on what am I doing wrong?

                  Btw.. I am using Cocos2d 2.0 on iOS 6.0, retina display iPod touch 4th generation.

                  EDIT:

                  Another example..

                  I thought that this configuration would do like in this and then do the symmetric thing from the end to the start but "upside down".

                  Any suggestions on what am I doing wrong?

                      ccBezierConfig bezier;
                  
                       self.position = CGPointMake(0.0f, 150.0f);
                       bezier.controlPoint_1 = CGPointMake(-20.0f, 290.0f);
                       bezier.controlPoint_2 = CGPointMake(260, 290.0f);
                       bezier.endPosition =CGPointMake(340.0f,150.0f);
                  
                      id bezierForward = [CCBezierBy actionWithDuration:3 bezier:bezier];
                  
                  
                      ccBezierConfig bezier2;
                      bezier2.controlPoint_1 = CGPointMake(340.0f, 10.0f);
                      bezier2.controlPoint_2 = CGPointMake(80, 10.0f);
                      bezier2.endPosition =CGPointMake(-20.0f,150.0f);
                  
                      id bezierReturn = [CCBezierBy actionWithDuration:3 bezier:bezier2];
                  
                  
                      [self runAction: [CCSequence actions:
                                        bezierForward, bezierReturn, [CCHide action],
                                        nil]];
                  

                  解决方案

                  I was using CCBezierBy but the examples are based on a CCBezierTo formula. Hence everything works as excpected if I use CCBezierTo instaed of CCBezierBy.

                  这篇关于Cocos2d 2.x:理解 ccBezierConfig 行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)

                  <small id='9JxgQ'></small><noframes id='9JxgQ'>

                  <legend id='9JxgQ'><style id='9JxgQ'><dir id='9JxgQ'><q id='9JxgQ'></q></dir></style></legend>

                      • <bdo id='9JxgQ'></bdo><ul id='9JxgQ'></ul>

                            <i id='9JxgQ'><tr id='9JxgQ'><dt id='9JxgQ'><q id='9JxgQ'><span id='9JxgQ'><b id='9JxgQ'><form id='9JxgQ'><ins id='9JxgQ'></ins><ul id='9JxgQ'></ul><sub id='9JxgQ'></sub></form><legend id='9JxgQ'></legend><bdo id='9JxgQ'><pre id='9JxgQ'><center id='9JxgQ'></center></pre></bdo></b><th id='9JxgQ'></th></span></q></dt></tr></i><div id='9JxgQ'><tfoot id='9JxgQ'></tfoot><dl id='9JxgQ'><fieldset id='9JxgQ'></fieldset></dl></div>
                            <tfoot id='9JxgQ'></tfoot>
                              <tbody id='9JxgQ'></tbody>