Quantcast
Viewing all 2747 articles
Browse latest View live

Cocos2dx framework only have js framework

@brighthead1995 wrote:

Two questions:

  1. how to use the command “cocos framework” in command line, i put in the command like this: “cocos framework -h”, and get error response, and i can not find any info about this command anywhere

  2. I got a cocos-js project now has only web framework, how do i creat other frameworks based on the js framework i’ve already got? see the difference between the photos, thx

Posts: 5

Participants: 2

Read full topic


Undefined symbols for architecture arm64 in cocos 2d-x 3.10 project

@FelixFox wrote:

Hello,

I’m working on an (five years) old cocos2dx project and I’m getting the following errors when debugging for AppleTV
Xcode 11 / tvOS 13 / cocos 2d-x 3.10

Apple Mach-O Linker (ld) Error

Undefined symbols for architecture arm64:
  "cocos2d::TextureCube::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      cocos2d::CameraBackgroundSkyBoxBrush::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libcocos2d tvOS.a(CCCameraBackgroundBrush.o)
  "cocos2d::TextureCube::setTexParameters(cocos2d::Texture2D::_TexParams const&)", referenced from:
      cocos2d::CameraBackgroundSkyBoxBrush::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libcocos2d tvOS.a(CCCameraBackgroundBrush.o)
  "RatingLayer::create()", referenced from:
      ParallaxApplication::createAndShowRatingLayer() in ParallaxApplication.o
  "RatingLayer::acquireBackdrop()", referenced from:
      ParallaxApplication::createAndShowRatingLayer() in ParallaxApplication.o
  "RatingLayer::setReturnCallback(std::__1::function<void ()>)", referenced from:
      ParallaxApplication::createAndShowRatingLayer() in ParallaxApplication.o
  "RatingLayer::hide()", referenced from:
      ParallaxApplication::ratingLayerCallback() in ParallaxApplication.o
  "RatingLayer::show()", referenced from:
      ParallaxApplication::createAndShowRatingLayer() in ParallaxApplication.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The code runs fine on iOS and macOS. This problem appears only on tvOS.
I’m not an experience coder but I know that the guys who build this code were. I’ve been stuck on this for the last two days and I feel I’m missing something stupid.
Any guidance is very appreciated.
Thanks in advance

Posts: 1

Participants: 1

Read full topic

iOS13 + tvOS13 error: MPMoviePlayerController is no longer available

@FelixFox wrote:

Apple no longer supports MPMoviePlayerController in iOS13 + tvOS13 causing the following error when running on xcode11:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'MPMoviePlayerController is no longer available. Use AVPlayerViewController in AVKit.'

I believe the error is associted with the cocos2dx UIVideoPlayer classes refered in the wrapper files: UIVideoPlayer-iOS.mm, UIVideoPlayer-mac.mm and UIVideoPlayer-iOS.h.

I know that @minggo from cocos 2dx dev team is working on this issue: https://github.com/cocos2d/cocos2d-x/pull/20085

  1. Do you know when will a version fixing this bug will be released?
  2. (kind of stupid question) is it ok just to replace the UIVideoPlayer files (UIVideoPlayer-iOS.mm, UIVideoPlayer-mac.mm and UIVideoPlayer-iOS.h) instead of migrating the entire project?

Thanks

Posts: 3

Participants: 2

Read full topic

Mac OS Catalina - System labels

@kmaker wrote:

Hi,
I just updated to macOS Catalina and system labels (like the ones created with cocos2d::Label::createWithSystemFont) are not showing properly.

Following the code in Device-mac.mm, it looks like the bitmapData obtained from the NSBitmapImageRep has 16 bit depth rather than the 8 bit expected.

This is also happening with apps compiled on High Sierra (i.e., without recompiling them).
Can someone confirm this?

Posts: 1

Participants: 1

Read full topic

macOS 10.15 and iOS 13 bug fixes

@slackmoehrle wrote:

Hi Everyone,

Just FYI, some issues that occur on macOS 10.15 (Catalina) and iOS 13 have indeed been fixed in our GitHub repo.

  1. System font label rendering issue on macOS Catalina. Corresponding issue: https://github.com/cocos2d/cocos2d-x/issues/20076

  2. VideoPlayer error on iOS 13 as MPMoviePlayerController is removed, corresponding pull request is https://github.com/cocos2d/cocos2d-x/pull/20085

  3. WebView error on iOS 13 as UIWebView is removed, corresponding pull reuqest is https://github.com/cocos2d/cocos2d-x/pull/20098

Posts: 2

Participants: 1

Read full topic

--- Article Removed ---

***
***
*** RSSing Note: Article removed by member request. ***
***

Migrate 32bit apps to 64bit android cocos

@Breakout wrote:

Hi all. Once I bought 14 apps with cocos framework, but don’t know cocos technology and I have to migrate them to 64bit versions, according to google play requirements. I don’t know cocos version in this apps, guess it is 2.2.6 or earlier. All apps have a libplayer.so lib only for 32bit processors, I think this lib is created when project is builded by cocos script through command line, but I don’t know how to add 64bit support. Any help is welcome =) Image may be NSFW.
Clik here to view.
libplayer

Posts: 3

Participants: 3

Read full topic

AudioEngine docs?

@digimikeh wrote:

hI !

i want to do a volume fade for my bgm when start and end a scene… however, there is no implementation for volume change on SimpleAudioEngine, so i need to switch to AudioEngine, but i could not find documentation how to use it, i was seeing API the only function i check to play sound is play2d, i tried to play my music and indeed works (i haven’t played with volume things yet) the problem is that seems i can´t to play two diferents audio at same time because i try i get this:

I/AudioEngine-Win32 (171): OpenAL was initialized successfully!
V/AudioCache (71): AudioCache() 0F1F3D7C, id=1
V/AudioCache (129): readDataTask begin, cache id=1
V/AudioPlayer (147): AudioPlayer::play2d, _alSource: 1, player id=1
V/AudioCache (294): readDataTask end, cache id=1
V/AudioCache (71): AudioCache() 0F1F44CC, id=2
V/AudioCache (129): readDataTask begin, cache id=2
D/AudioEngine-Win32 (280): AudioEngineImpl::_play2d, cache was destroyed or not ready!
V/AudioCache (294): readDataTask end, cache id=2
V/AudioPlayer (69): ~AudioPlayer() (0F19BDF8), id=2
V/AudioPlayer (83): AudioPlayer::destroy begin, id=2
V/AudioPlayer (128): Before alSourceStop
V/AudioPlayer (130): Before alSourcei
V/AudioPlayer (136): AudioPlayer::destroy end, id=2

Posts: 6

Participants: 2

Read full topic


Is Renderer::beginRenderPass() doing too much?

@trojanfoe wrote:

I noticed that when doing a frame capture on Xcode that there were repeated setting of the viewport, winding mode, scissor rect, etc. that would customarily be done once, at the very start of the render. This appears to come from Renderer::beginRenderPass():

void Renderer::beginRenderPass(RenderCommand* cmd)
{
     _commandBuffer->beginRenderPass(_renderPassDescriptor);
     _commandBuffer->setViewport(_viewport.x, _viewport.y, _viewport.w, _viewport.h);
     _commandBuffer->setCullMode(_cullMode);
     _commandBuffer->setWinding(_winding);
     _commandBuffer->setScissorRect(_scissorState.isEnabled, _scissorState.rect.x, _scissorState.rect.y, _scissorState.rect.width, _scissorState.rect.height);
     setRenderPipeline(cmd->getPipelineDescriptor(), _renderPassDescriptor);

    _commandBuffer->setStencilReferenceValue(_stencilRef);
}

Is it possible that we can remove these unnecessary calls from that method and put them somewhere else? I would imagine they are not required in OpenGL either?

What do people think?

Posts: 2

Participants: 2

Read full topic

--- Article Removed ---

***
***
*** RSSing Note: Article removed by member request. ***
***

Collisions with DragonBones animations

@PEHM wrote:

Hi, i am using dragonbones to make skeletal animations. I’ve imported the swordsman data into my cocos proyect and now, i want to make that the attack animation generates collisions with another game character.

I have created a bounding box in dragonbones and I have created a phyisic polygon body with box2d, i linked the CCarmatureDisplay object as a userdata and i’ve got move my armature in my physics world applying forces and gravity. The problem is that i also need that the body be moved with the animacion so when the swordsman attack, its hits can generate a collision with another physic body.

I have used the body->SetTransform() metod but the bodies don’t collide, that’s because the body is frecuently updating its coordinates and when the collision occurs it tries to react according to but the position is inmediatly updated.

I need some idea, about how can i detect collisions from an skeletal animation made with dragonbones, i need it for a dynamic fighting game.
Thanks in advance!Image may be NSFW.
Clik here to view.
:grinning:
.

Posts: 1

Participants: 1

Read full topic

Character code instead of key code

@AndreyFomin wrote:

I heed to detect character code typed on the keyboard. The event onKeyPressed returns key code but I need character code instead because I have different actions for ‘{’ and ‘[’, for example. Could you please advice how to obtain this codes. Thanks!

Posts: 1

Participants: 1

Read full topic

Android bottom inset

@DanielRossler wrote:

How do I get,
for android phones that has rounded corners on the bottom,
Samsung Galaxy S10, for example,
the bottom margin size that I should exclude from my display ?

There is a Java method of the class DisplayCutout (api level 28),
named getSafeInsetBottom() that should return this.

Is there support for this in 3.17 ?

Posts: 1

Participants: 1

Read full topic

cmake x86_64 Android problem with PluginIAP

@ComputerDev wrote:

Hello there,
" Starting August 1, 2019, your apps published on Google Play will need to support[64-bit architectures."
So I tried by adding x86_64 to PROP_APP_ABI but I get this error:

Build command failed.
Error while executing process C:\Users\ComputerDev\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Users\ComputerDev\cocos2d-x-projects\Werewolves\proj.android\app\.cxx\cmake\debug\x86_64 --target MyGame}

ninja: error: '../../../../jni/PluginIAP/libs_c++_static/x86_64/libPluginIAP.a', needed by '../../../../build/intermediates/cmake/debug/obj/x86_64/libMyGame.so', missing and no known rule to make it

PROP_COMPILE_SDK_VERSION=28
PROP_MIN_SDK_VERSION=16
PROP_TARGET_SDK_VERSION=28
PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86:x86_64
PROP_BUILD_TYPE=cmake

Posts: 1

Participants: 1

Read full topic

Rework CMake Xcode support

@trojanfoe wrote:

It seems the mandatory use of cmake in the upcoming v4 branch has come as something of a shock to some users and I have spent some time recently customizing the cmake process to my own liking. I was asked by @zhangxm to create a pull request for these changes, which I have now done, and I have also added to the existing cmake documentation (see cmake/README.md) to provide insights on how to specify common customizations.

I am certain there is more to say, not just about Xcode, but about all the IDEs used, as they can all be customized in similar ways. I hope that other users will contribute in this area with their own changes and tips in order to make using cmake the success I am certain it will be.

I would also be interested in anyone’s opinion on this change.

Posts: 1

Participants: 1

Read full topic


log() only works with string literals..

@digimikeh wrote:

Hello friends…
i would like to print a variable value into console, but it is not doing…

void init(){
     //... all default events and expressions...
     this->scheduleUpdate();
}

void update(float dt){
     log("A");       //this prints fine...
     log(myVar);  //this prints nothing
}

myVar is a float declared on header…

I have tried with std::cout too with no result… is there any other way to print variables?

Thanks!

Posts: 3

Participants: 3

Read full topic

V4 would be a good time to move things forward?

@trojanfoe wrote:

With the release of v4 looming on the horizon, I think it would be a good time to make code-breaking changes.

  • Move from C++11 to C++14 to gain fundamental language benefits.
  • Move AudioEngine out of the experimental namespace (isn’t it the only audio engine available anyway?)
  • Move FastTMX out of the experimental namespace.
  • Move everthing else out of the experimental namespace if it’s been there more than 12 months!

What do people think?

Posts: 15

Participants: 3

Read full topic

display sprite from URL

@Hemchand wrote:

I am getting this error: ‘SecurityError: The operation is insecure.’
for this code:

    var winSize = cc.director.getWinSize();
    var that = this;

    var imageURL = "https://discuss.cocos2d-x.org/uploads/default/original/3X/c/9/c9a024cd3656916ac85bb3a01034f8075bc8f827.png";
    cc.loader.loadImg(imageURL,  {isCrossOrigin : true}, function(err, texture)
    {


        var spriteTest = new cc.Sprite(texture);
        spriteTest.setPosition(winSize.width / 2, winSize.height / 2);
        that.addChild(spriteTest);
    });

Posts: 1

Participants: 1

Read full topic

Unknown Crash in android

@shaktiraj wrote:

Cocos2dx version 3.17.2

and ndk 19.2.5345600

Crash log(i have changed package name)

pid: 0, tid: 0 >>> com.demo.game <<<

backtrace:

#00 pc 0000000000049df4 /system/lib/libc.so (tgkill+12)

#01 pc 0000000000047593 /system/lib/libc.so (pthread_kill+34)

#02 pc 000000000001d855 /system/lib/libc.so (raise+10)

#03 pc 00000000000193a1 /system/lib/libc.so (__libc_android_abort+34)

#04 pc 0000000000017014 /system/lib/libc.so (abort+4)

#05 pc 000000000001b84f /system/lib/libc.so (__libc_fatal+22)

#06 pc 000000000001959b /system/lib/libc.so (__assert2+18)

#07 pc 00000000008e784d /data/app/com.demo.game-1/lib/arm/libMyGame.so

#08 pc 00000000008e7955 /data/app/com.demo.game-1/lib/arm/libMyGame.so

#09 pc 00000000008e5ead /data/app/com.demo.game-1/lib/arm/libMyGame.so

#10 pc 00000000008e5843 /data/app/com.demo.game-1/lib/arm/libMyGame.so

#11 pc 00000000008e580b /data/app/com.demo.game-1/lib/arm/libMyGame.so (__cxa_throw+74)

#12 pc 00000000008b1f9d /data/app/com.demo.game-1/lib/arm/libMyGame.so (_Znwj+56)

#13 pc 0000000000571868 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZNSt6__ndk16vectorIN7cocos2d11V3F_C4B_T2FENS_9allocatorIS2_EEE8__appendEj+148)

#14 pc 0000000000571374 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN5spine13SkeletonBatch16allocateVerticesEj+92)

#15 pc 0000000000560fe4 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN5spine16SkeletonRenderer4drawEPN7cocos2d8RendererERKNS1_4Mat4Ej+624)

#16 pc 0000000000612a60 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d4Node5visitEPNS_8RendererERKNS_4Mat4Ej+316)

#17 pc 0000000000612ac0 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d4Node5visitEPNS_8RendererERKNS_4Mat4Ej+412)

#18 pc 0000000000612ac0 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d4Node5visitEPNS_8RendererERKNS_4Mat4Ej+412)

#19 pc 0000000000612ac0 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d4Node5visitEPNS_8RendererERKNS_4Mat4Ej+412)

#20 pc 0000000000630eec /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d5Scene6renderEPNS_8RendererEPKNS_4Mat4ES5_j+460)

#21 pc 0000000000630d14 /data/app/com.demo.game-1/lib/arm/libMyGame.so (ZN7cocos2d5Scene6renderEPNS_8RendererERKNS_4Mat4EPS4+28)

#22 pc 0000000000696f98 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d8Director9drawSceneEv+496)

#23 pc 0000000000699fa0 /data/app/com.demo.game-1/lib/arm/libMyGame.so (_ZN7cocos2d8Director8mainLoopEv+128)

#24 pc 00000000004af61d /data/app/com.demo.game-1/oat/arm/base.odex

@Big_Bear @zhangxm @shivmsit @slackmoehrle any suggestion?

thanks in andvance .

Posts: 2

Participants: 2

Read full topic

Problems with NDK not supporting c++ 14

Viewing all 2747 articles
Browse latest View live