Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all 2748 articles
Browse latest View live

Libfmod.so file too short

$
0
0

@digimikeh wrote:

Hi!
after rebuild the whole project and everything went fine… i try to run my helloworld project… but i get this:

error while loading shared libraries: /home/miguel/Desktop/Cocos2dx/Akrasiel/cocos2d/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so.6: file too short

i checked multiples solutions including symbolic links with no result…

any tips?
thanks…

Posts: 1

Participants: 1

Read full topic


Linux installation docs?

Unable to Build after 3rd-party-libs update

$
0
0

@ashishfeels wrote:

I Recently Updated the 3rd Party libs by running the download-deps.py it was successful but im not able to build android app. Im Using v3.17.1 of Cocos2d-js

The following error pops-up

FAILED: /home/theta/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  --target=armv7-none-linux-androideabi21 --gcc-toolchain=/home/theta/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/theta/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot  -DANDROID -DCOCOS2D_DEBUG=1 -DLWS_WITH_LIBUV -DUSE_FILE32API -I../../../../../../../cocos2d-x/cocos/editor-support -I../../../../../../../cocos2d-x -I../../../../../../../cocos2d-x/cocos -I../../../../../../../cocos2d-x/extensions -I../../../../../../../cocos2d-x/cocos/platform -isystem ../../../../../../../cocos2d-x/external/Box2D/include -isystem ../../../../../../../cocos2d-x/external/chipmunk/include -isystem ../../../../../../../cocos2d-x/external/freetype2/include/android/freetype2 -I../../../../../../../cocos2d-x/external/recast/.. -isystem ../../../../../../../cocos2d-x/external/bullet/include -isystem ../../../../../../../cocos2d-x/external/bullet/include/bullet -isystem ../../../../../../../cocos2d-x/external/jpeg/include/android -isystem ../../../../../../../cocos2d-x/external/openssl/include/android -isystem ../../../../../../../cocos2d-x/external/tiff/include/android -isystem ../../../../../../../cocos2d-x/external/uv/include -isystem ../../../../../../../cocos2d-x/external/webp/include/android -isystem ../../../../../../../cocos2d-x/external/websockets/include/android -I../../../../../../../cocos2d-x/external/tinyxml2/. -I../../../../../../../cocos2d-x/external/xxhash/. -I../../../../../../../cocos2d-x/external/xxtea/. -I../../../../../../../cocos2d-x/external/clipper/. -I../../../../../../../cocos2d-x/external/edtaa3func/. -I../../../../../../../cocos2d-x/external/ConvertUTF/. -I../../../../../../../cocos2d-x/external/poly2tri/.. -I../../../../../../../cocos2d-x/external/md5/.. -isystem ../../../../../../../cocos2d-x/external/curl/include/android -isystem ../../../../../../../cocos2d-x/external/png/include/android -I/home/theta/Android/Sdk/ndk-bundle/sources/android/cpufeatures -I../../../../../../../cocos2d-x/external/android-specific/pvmp3dec/include -I../../../../../../../cocos2d-x/external/android-specific/pvmp3dec/src -I../../../../../../../cocos2d-x/external/android-specific/tremolo/. -isystem ../../../../../../../cocos2d-x/external/zlib/include -I../../../../../../../cocos2d-x/external/unzip/. -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -march=armv7-a -mthumb -mfpu=neon -Wa,--noexecstack -Wformat -Werror=format-security  -frtti -fexceptions -fsigned-char -O0 -fno-limit-debug-info  -fPIC   -std=gnu++11 -MD -MT engine/cocos/core/CMakeFiles/cocos2d.dir/platform/CCFileUtils.cpp.o -MF engine/cocos/core/CMakeFiles/cocos2d.dir/platform/CCFileUtils.cpp.o.d -o engine/cocos/core/CMakeFiles/cocos2d.dir/platform/CCFileUtils.cpp.o -c /home/theta/sq-mobile/frameworks/cocos2d-x/cocos/platform/CCFileUtils.cpp
  /home/theta/sq-mobile/frameworks/cocos2d-x/cocos/platform/CCFileUtils.cpp:733:19: error: no matching function for call to 'unzLocateFile'
          int ret = unzLocateFile(file, filename.c_str(), 1);
                    ^~~~~~~~~~~~~
  ../../../../../../../cocos2d-x/external/unzip/./unzip.h:253:20: note: candidate function not viable: no known conversion from 'int' to 'cocos2d::unzFileNameComparer' (aka 'int (*)(void *, const char *, const char *)') for 3rd argument
  extern int ZEXPORT unzLocateFile(unzFile file, const char *filename, unzFileNameComparer filename_compare_func);
                     ^
  1 error generated.
  ninja: build stopped: subcommand failed.

@slackmoehrle @PatriceJiang @minggo @Zinitter any help regarding this

Posts: 1

Participants: 1

Read full topic

file too short for libfmod

$
0
0

@digimikeh wrote:

i tried anything, this is the last wall i face before i get my game shows on the screen :lying_face:

/home/simoncillo/Desktop/cocos2d-x-3.17.2/build-AkrasielGame-Desktop_Qt_5_12_5_GCC_64bit-Debug/bin/AkrasielGame/AkrasielGame: error while loading shared libraries: /home/simoncillo/Desktop/cocos2d-x-3.17.2/AkrasielGame/cocos2d/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so.6: file too short

No symlink worked… what to do ?
i have downloaded cocos zipi, unpacked, installed dependencies, created my project, added flag to CMakeFiles.txt, compiled all this successfuly, but when i run my game, this error comes up…

Posts: 2

Participants: 2

Read full topic

AGXGLDriver crash

$
0
0

@sayem_musk wrote:

From Crashlytics i am getting this kind of crashes

  • gldUpdateDispatch

its only happening in ios. There is no problem for android

i could not figure out what casing this crashes

From Crashlytics i got this suggestion

Based on the stack trace displayed here, it looks like new calls triggering OpenGL rendering took place while the app was transitioning to, or from, a background state. If you set up OpenGL drawing in your app delegate's methods, make sure that you only did so in applicationDidBecomeActive:, never in application:willFinishLaunchingWithOptions: or application:didFinishLaunchingWithOptions:. According to some reports, even displaying an FPS indicator for SpriteKit could cause rendering to occur before it is allowed.

But current cocos2dx system how this is possible?

Please Help me

Posts: 2

Participants: 2

Read full topic

problems when using TTF with Hindi language

$
0
0

@smirkking wrote:

“हिंदी” meas “Hindi” in Hindi language.

When I create Label with system font, it shows exact the same with plain text.
image

But when I create Label with TTF, it shows diffrent with plain text.
image

This is the TTF font downloades from Google Font.

Posts: 1

Participants: 1

Read full topic

Need some input on BM font drawing using TriangleCommand

$
0
0

@R101 wrote:

I’ve been trying to find ways to reduce the draw calls due to the usage of labels in certain places, like ui::ImageView with a child label added as ui::ListView items, where we can’t easily set the labels to a different global Z layer given that the ListView needs clipping enabled. What happens there is that it switches between the sprite sheet being used for the ImageView and the BM font texture for every single item in the ListView, which adds up to a considerable number of draw calls.

So, given that BM Labels are rendered using QuadCommand, I modified it to instead us TriangleCommand, so I can have the BM font texture embedded in the larger sprite sheet, in the hope that I can manage to get them batched together (assuming they’re using the same shader and such).

Anyhow, I don’t know enough about these things to see any possible issues, so if anyone has advice or suggestions, then please do mention them.

I modified the following code to change them to TriangleCommand:

CCLabel.c:

void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
{
    ...
            const auto textureAtlas = _batchNodes.at(0)->getTextureAtlas();
            const auto totalQuads = textureAtlas->getTotalQuads();

            TrianglesCommand::Triangles triangles;
            triangles.indices = textureAtlas->getIndices();
            triangles.verts = (V3F_C4B_T2F*)textureAtlas->getQuads();
            triangles.vertCount = 4 * totalQuads;
            triangles.indexCount = 6 * totalQuads;
            _trianglesCommand.init(_globalZOrder, textureAtlas->getTexture()->getName(), getGLProgramState(), _blendFunc, triangles, transform, flags);
            renderer->addCommand(&_trianglesCommand);

            // The following is the QuadCommand that was replaced
            //auto textureAtlas = _batchNodes.at(0)->getTextureAtlas();
            //auto texture = textureAtlas->getTexture();
            //_quadCommand.init(_globalZOrder, texture, getGLProgramState(), 
            //    _blendFunc, textureAtlas->getQuads(), textureAtlas->getTotalQuads(), transform, flags);
            //renderer->addCommand(&_quadCommand);

    ....

CCTextureAtlas.h:

    GLushort* getIndices() { return _indices; }

The code above works, and renders the labels in their entirety. The next step is to figure out the best way to get the BM font to handle a texture in a larger sprite sheet.

I noticed another thread regarding this same issue, https://discuss.cocos2d-x.org/t/mixing-sprites-and-bitmap-fonts-on-a-single-texture-to-limit-draw-calls/26088/6, but the discussion seemed to stop without any results.

Is there any reason this wasn’t done previously, or any reason it shouldn’t be done this way?

EDIT:
There is some support in the current Cocos2d-x code for supplying a BM font texture that exists inside a bigger texture, so the following worked (went from 60+ draw calls to 2…):

const auto fontFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("arimo_40.png"); // This is in a larget texture
const auto label = Label::createWithBMFont("arimo_40.fnt", "TEXT", TextHAlignment::CENTER, 0, fontFrame->getRectInPixels().origin);

arimo_40.fnt is modified to reference the larger spritesheet name, which for this example is “spritesheet-0.png”:

info face="Arimo" size=40 bold=1 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
common lineHeight=40 base=32 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
page id=0 file="spritesheet-0.png"

The only thing it doesn’t seem to support is if the font texture is rotated inside the bigger sprite sheet, but that’s something that may be easy to fix.

Posts: 1

Participants: 1

Read full topic

Editbox font setFontName is not working

$
0
0

@chiragkevadiya wrote:

editName = ui::EditBox::create(Size(200, 40), ui::Scale9Sprite::create(“back.png”));
editName->setFont(“AmsiPro-Black.ttf”, 20);

editName = ui::EditBox::create(Size(200, 40), ui::Scale9Sprite::create(“back.png”));
editName->setFont(“font.fnt”, 20);

I want to change the font or I want to set fnt font file but it does not work. @slackmoehrle please help me
i use cocos2dx 3.17

Posts: 1

Participants: 1

Read full topic


How to implement infinite scroll

$
0
0

@CrazyHappyGame wrote:

Hi,

How do you implement infinite scroll?
(i.e.: facebook …)
I would like to display big set of images (up to thousands).
Images are local or from network.

Sample code welcome :slight_smile:

Regards,
Chp

Posts: 2

Participants: 2

Read full topic

Help For Object Pooling

$
0
0

@Refetizm wrote:

Hi everyone,

The character I created will shoot, and I have to create the bullets using the object pooling method. I found a few examples, but I need someone to help me understand this. Is there anyone here who can tell me this step by step? From here or through another channel (skype, discord, etc.)

Posts: 2

Participants: 2

Read full topic

How do you create UI?

cocos in cmd doesn't do anything

$
0
0

@SimonArchNox wrote:

Hey All :smiley_cat:
I’ve installed the new cocos version a few days ago: 3.17.2
Managed to successfully compile in visual studio and create new projects.
I have a bat file that creates new projects and when I used it today it actually didn’t do anything… furthermore I don’t see any response in cmd when typing cocos (neither an error).
I’ve run setup.py again and restarted my laptop but still the same thing… what could be the issue here?

Here’s the bat file:
SET projName=projectYYY
REM for example com.MyCompany.AwesomeGame
SET projBundle=com.hello.projectYYY
SET projPath=D:\Projects\
cd D:\Cocos2dx\cocos2d-x-3.17.2\tools\cocos2d-console\bin
cocos new %projName% -p %projBundle% -l cpp -d %projPath%
PAUSE

Also here’s a pic of my environment variables, seems everything is there:
1

Posts: 2

Participants: 2

Read full topic

Lua - crypt string constant of bytecode

AudioEngine::getVolume-->The audio instance 0 is non-existent

$
0
0

@digimikeh wrote:

Hi!.
I’m currently using Lubuntu 19, installed everything and all is ok thanks to Slack help, The HelloWorld from Cocos2dx worked fine, no warnings, no errors, sample was showed on screen, that’s good…

Now, i have translated all my code made in Windows into Linux… then tried to run and there is an error:

/usr/bin/ld: ../../cocos2d/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)

but this error does not stopped the execution so i put to continue, and game showed up… with no sound.

the Application Output says:

AudioEngine::getVolume-->The audio instance 0 is non-existent

What could it be?
Thanks.

Posts: 1

Participants: 1

Read full topic

Can i change viewport of camera without creating fbo?

$
0
0

@lmartinignacio wrote:

Hello folks. I 'd found this code on CCCamera.cpp

void Camera::applyViewport()
{
    glGetIntegerv(GL_VIEWPORT, _oldViewport);

    if(nullptr == _fbo)
    {
        glViewport(getDefaultViewport()._left, getDefaultViewport()._bottom, getDefaultViewport()._width, getDefaultViewport()._height);
    }
    else
    {
        glViewport(_viewport._left * _fbo->getWidth(), _viewport._bottom * _fbo->getHeight(),
                   _viewport._width * _fbo->getWidth(), _viewport._height * _fbo->getHeight());
    }
}

And because that frame buffer is always nullptr it never uses the viewport i 'd set.

I only want to create 2 cameras to follow 2 players and set viewports like dividing the screen.

Do i really need that fbo? how do i create it?

Any help will be appreciated.

thanks!

Posts: 1

Participants: 1

Read full topic


Pull request didn't pass ci

$
0
0

@DEAGS3000 wrote:

It’s my first time to contribute to cocos2d-x, I’ve submitted a pull request, it didn’t pass the ci. The test fails on some error of lua library, but I didn’t modified any code of it, the diff proved that.
By the way, my own test case runs, but some of them are not since I cloned the repo.

Is there sth I need to do?

Posts: 3

Participants: 2

Read full topic

Integrate Cocos Creator project to Cocos2dx C++ project

$
0
0

@sonlehong wrote:

Hi,
Currently, I have a big project (game A) which was developed by Cocos2dx C++ for Android and iOS, I have another small project (mini-game B) which was developed by Cocos Creator. I want to integrate mini-game B into game A. But I cannot figure out a possible way to do it.
I tried with this article https://docs.cocos2d-x.org/cocos2d-x/v3/en/editors_and_tools/creator_to_cocos2dx.html, but it seems just exporting UI part (like Cocos Studio we had before), not including scripts to execute events such as button click, update, …
I’m thinking about using js bindings to call js output files that were built by Cocos Creator. It familiars with js bindings of cocos2dx JS. But I don’t know how to do it. The js output files of Cocos Creator are so different from those ones of the cocos2dx JS project, so I cannot use the bindings code of Cocos2dx to call that js output files of Cocos Creator. I did research all this day to find the right way to do it but no luck.
I’m using Cocos2dx version 3.17 and Cocos Creator version 2.2.0.
Can you give me some advice? Any advice would be appreciated. Thank you!

Posts: 1

Participants: 1

Read full topic

Childs of layer inherits camera mask?

$
0
0

@lmartinignacio wrote:

Does childs of layer inherits the camera mask that i set on layer?

is there an order to do it?

m_layer = Layer::create();
auto camera = Camera::createPerspective(60, (GLfloat)s.width / s.height, 1, 1000);
camera->setCameraFlag(CameraFlag::USER3);
m_layer->addChild(camera);
m_layer->setCameraMask(static_cast<int>(CameraFlag::USER3));
addChild(m_layer);

auto spr = Sprite::create("someSpriteName");
m_layer->addChild(spr);

what camera mask should be on spr?

Posts: 3

Participants: 2

Read full topic

--- Article Removed ---

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

Cocos 2d-x: Present and Future

$
0
0

@FelixFox wrote:

Dear all,

I’m quite new to cocos 2d-x, and probably I should have know better before starting this topic, but I love cocos 2d-x (it is C++ and cross-platform - what is not to like) and simultaneously have strong concerns regarding the present stage and future development of this platform.

I would really like to ear from experienced users.

The Present

  1. The learning curve is really, really hard;
    Most of the learning resources you reference in the manual and in README.md are outdated by aprox. 5 years: broken links, exemples made in old cocos versions that don’t run anymore, references to Cocos Studio (deprecated),…
    Please make it easier for new programmers to come and join the platform.
    updatedTutorials -> easierLearningCurve -> moreCocos2dxUsers -> moreContributors;
  1. It is hard to update a cocos 2d-x project;
    Apple seems to be deprecating everything ( OpenGl, UIWebViews,…) and it is very hard to keep existing projects made in older cocos 2d-x versions. Though the topic is widely discussed in the forum, there seems to be no consensus and I would like to ask for an official guideline.

  2. What is happening behind the scenes?
    How many developers are actively working on cocos2d-x development?
    …well, according to GitHub many, but consistently, only two: @minggo and @coulsonwang, which BTY, I would like to acknowledge (as well as @slackmoehrle, for being the forum super-glue). Who is supporting this team?

The Future

  1. The broken links and outdated resources (e.g. https://github.com/cocos2d/cocos2d-x/blob/v3/README.md) make look like the platform is being abandoned … is that so?

  2. Is the development of a supporting library in the future plans (e.g. implement pinch to zoom, scroll view, etc…) ?

  3. I’ve noticed you have abandoned Trello and now rely on Github Milestones. What about the long term plans?

  4. What are the plans for AppleTV and AndroidTV?

Please do excuse me for this rather long post.
Feedback is welcome.

Cheers,

Felix

Posts: 2

Participants: 2

Read full topic

Viewing all 2748 articles
Browse latest View live