现在我关注文章http://www.cocos2d-x.org/wiki/Effects.链接的示例会产生错误.经过测试的cocos2d-x版本是cocos2d-x 3.2beta0.
我的代码:
auto bgimage = Sprite::create("top.png");
bgimage->setPosition(visibleSize / 2);
// create a Lens3D action
ActionInterval* lens = Lens3D::create(10, Size(32, 24), Vec2(100, 180), 150);
// create a Waved3D action
ActionInterval* waves = Waves3D::create(10, Size(15, 10), 18, 15);
// create a sequence an repeat it forever
bgimage->runAction(RepeatForever::create(Sequence::create(waves, lens, NULL)));
this->addChild(bgimage);
Run Code Online (Sandbox Code Playgroud)
结果日志:
Assert failed: GridActions can only used on NodeGrid
Assertion failed!
File: CCActionGrid.cpp
Line: 84
Run Code Online (Sandbox Code Playgroud)
我弄错了什么?即使我删除液体动作线,wave3d和lens3d也显示我同样的错误.
我写了一个Angular工厂.对我来说有一个严重的错误.我徘徊修复它.最后,我清除了这个问题......没有理由.所以我需要清楚地描述下面的代码问题.
这是我的代码A:
angular
.module('BinD', ['ngSails'])
.factory('UserService', function ($sails) {
...
});
Run Code Online (Sandbox Code Playgroud)
另一个B是:
(function (angular) {
'use strict';
angular
.module('BinD', ['ngSails'])
.factory('UserService', function ($sails) {
...
});
})(angular);
Run Code Online (Sandbox Code Playgroud)
错误部分是:
(function (angular) {
'use strict';
angular
.module('BinD', ['ngSails'])
.controller('SignUpCtrl', function ($scope, $window, UserService) {
Run Code Online (Sandbox Code Playgroud)
代码B效果很好.代码一个错误消息"UserServiceProvider未知(可能?)".我真的不知道为什么前面提到的两个相同的代码工作方式不同.让我知道.