Quantcast
Channel: Cocos Forums - Latest topics
Viewing all 17068 articles
Browse latest View live

Office Hours: Tuesday 11/5

$
0
0

@slackmoehrle wrote:

Hi Everyone,

I will be holding Office Hours, Tuesday 11/5 starting at about 8am EST and lasting until it makes sense to stop. I’ll update this post with a Twitch link later today.

The scope can be anything that you like. If I don’t know the answer, I’ll get the answer and get back to you.

A few things I may be working on when you join:

  • Creator tutorial creation
  • updating some Linux docs for clarification.
  • @Refetizm has an FPS bug that I thought I might take a look at live.
  • I might dust off one of my c++ games and get it back I shape to then port to Creator as part of a continued live stream tutorial our team has been thinking about

However the main point is for you to stop in and ask whatever. Comment below if you have something interesting.

Posts: 2

Participants: 1

Read full topic


Load new scene and return to the old one

$
0
0

@cgcg wrote:

There is a problem when i switch to new scene and return to the old scene some vars and reference keep their data and that cause a problem is there is any way to clear the vars when switch scene !

Posts: 2

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

Effects and Materials Documentation

$
0
0

@wugols2004 wrote:

Good day, just want to ask if there is any resources or documentation in using the new effects and materials in v2.2.0? Tried searching but to no avail :frowning:

Posts: 1

Participants: 1

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

Creator with c++ issues

$
0
0

@piotrros wrote:

Hello,
after a lot of time, I gave Cocos Creator another chance. Last time I’ve tried importing my cocos studio project, I’ve got tons of errors, so I couldn’t really do anything. But, I’ve downloaded latest Creator and importing worked. However, I’m struggling with a lot of smaller or bigger issues.

To begin with: in most projects projects I use Cocos Studio in a simple way:

root = CSLoader::createNode("PlayScene.csb");

and I go on from it. Not really using animations and other stuff. Just loading prepared scene and doing other stuff in code.

So it should be a simple task.

  1. Setup

I’ve downloaded latest creator plugin from here:

latest update 2 years ago doesn’t sound promising.

As I said before, I’ve successfully imported whole project made in Cocos Studio. I’ve opened the first scene and at the first glance it looks just fine.

I don’t know if it’s important or causes some problems, but every time I save (which calls creator-luacpp-support to copy the resources) I’m getting following warning:

‘Editor.projectInfo.path’ has been deprecated, please use ‘Editor.Project.path’.

and 2 errors:

  • SyntaxError: Unexpected token <

  • ReferenceError: cocosAnalytics is not defined

But it seems to be working anyway.

On the XCode side, after initial struggle with setting up header paths, I’ve added reader code.

  1. Code part

I set up design resolution differently so I had to comment out few lines in reader->setup.

auto reader = creator::CreatorReader::createWithFilename("creator/HideAndSeek/PlayScene.ccreator");
reader->setup();
    
auto scene = reader->getSceneGraph();
root = scene->getChildByName("Scene");

addChild(root);

Scene shows, but every object from the scene has all properties set to default (position is 0, 0; scale is 100% etc).

Also, I’ve found out that one object from the scene in creator is broken - it was a Node from separate file, but it didn’t load (only empty Node showed). I had to re-add it (as a prefab). It showed, but again mispositioned. The children also were mispositioned.

Editor:

On device (iPhone X):

After fixing root position:

root->setPosition(480, 320);

Title is so big, because it should have 50% scale, but it resets to 100%.

  1. Other issues

Saving (via plugin) is really slow, it takes about 20-30 seconds, while in cocos studio it takes 2-3 seconds (not mentioning ugly windows popping out).

What’s going on? Is anyone using creator in c++ projects and knows if there’s a possibility to fix these issues?

Posts: 1

Participants: 1

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


Android app built with minSdkVersion 19 does not launch on Android 4.4.2 (api 19)

$
0
0

@FocusCreative wrote:

Hi folks.
My game is building and running successfully with target api level 19 on my Android 4.4.2 device.
I’ve changed target api level to 28 according to Google Play’s requirements. App builds successfully but does not launch on my phone even minSdkVersion is 14.
I’ve tested on Android 6 device and it’s running but not on Android 4.4.2

Do you have any ideas?

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: 1

Participants: 1

Read full topic

On what technology sits Cocos Creator

$
0
0

@flashjaysan wrote:

Hi everyone!
I’d like to know more about the inner workings of Cocos Creator.
First let’s talk about what I believe to know already. So feel free to correct me if I’m wrong.
cocos2d-x is a game library written in C++.
cocos2d-js is a JavaScript binding of cocos2d-x.
Cocos Creator is a desktop software that provides a visual editor alongside an engine using cocos2d-js.
So here are my questions:
Does Cocos Creator is a web application embedded inside some kind of wrapper (like electron as the youtuber GamesFromScratch assumed) or is it a native desktop application?
Does Cocos Creator exports projects natively to HTML5 or does it use some conversion tools like webassembly or something like that to convert a native C++ app (from cocos2d-x) to HTML5?
In fact, I want to know if HTML5 export is a pure JavaScript application or if it relies of a native transcompilation.
Finally, does Cocos Creator exporte projects natively to Desktop or does it export to HTML5 then converts it to a desktop appliction with eletron or something like that?
How does JavaScript executes in desktop application exports? Since browsers come by default with a JavaScript interpreter I assume it is no problem for them but what about desktop projects? Do thos projects embed with them a JavaScript compiler?
All those questions come from the same issue: performance and size. What is the most performant platform for project exports? What is the most lightweight? Which platform is the native target? Which ones come with intermediary tools?
Please try to be very exhaustive in your answers (even giving me reasons for those design choices) for me to better understand what compromise I have to make for each target.
Thanks in advance.

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

Cocos Creator 2.2 - Capture texture problem

How do you create UI?


cc.PhysicsChainCollider.points and Animation

$
0
0

@achkasovmaxim wrote:

Hello, tell me, please. I have a sprite animation. How to make cc.PhysicsChainCollider.points change on every frame? I assigned them tags, but anyway, if I switch from sprite to sprite, the settings get lost. What to do?

Posts: 1

Participants: 1

Read full topic

Https not working in latest android devices to read a xml file data using cocos2dx 3.17 c++

$
0
0

@RoyalStormStudio1 wrote:

m using cocos2dx 3.17 to build game using c++…i port game on android side and reading mxl file using https …but it is not working .Game stuck on loading while reading data from xml…it works fine with http on older android devices but not latest android devices due to security.now we change our link to https but its not loading data on older devices and stuck on latest android devices. All help is greatly appreciated .
here is the xm file…
https://ugogoentertainment.com/PromoApps/FullScreenAds.xm

Posts: 8

Participants: 4

Read full topic

Plans for Huawei (AppGalery)?

$
0
0

@serpri wrote:

Q1: Does Cocos has plans for Huawei (AppGalery) ?
Q2: for implementation of Huawei Game Service?
Q3: for implementation of Huawei Ads Kit?
Q0: Are there convenient way to get money (into European/USA bank account) from China for advertisement or IAP - from Huawei or some other China company ?

Posts: 1

Participants: 1

Read full topic

[iOS][Android] Filipino Nonograms

$
0
0

@ondesly wrote:

Hi everyone!

I have just released my new puzzle game Filipino Nonograms!

Cocos2d-x allows me to implement all my ideas! I had wanted that the game had consumed less energy, so I made a few changes in the engine and now the game decreases frame rate to 1 fps, if there are no node changes. So simple!
And because of C++ I can write very fast and compact code. I can make every part of a game, how I want.

It’s amazing engine! I want to thank the Cocos team and everyone in the community!

Apple App Store
Google Play

Feedback is welcome :wink:

Posts: 1

Participants: 1

Read full topic

ReferenceError: Phaser is not defined

$
0
0

@charliegeorge wrote:

I am getting this error while loading my phaser.min script but have defined the local path as seen in the screenshots. I have also enabled the plugins for both js files as seen in the top right of the screen. Can anyone please shine some light on this?

The tutorial I am following: https://www.youtube.com/watch?v=okK5zQ8Gtqc

The link to the source files I am trying to use: https://ansimuz.itch.io/tiny-rpg-forest/download/eyJleHBpcmVzIjoxNTczMjI5OTc1LCJpZCI6MjIyMTk3fQ%3D%3D.eZtkzWFnFdINcMndmSysmDfczIk%3D


Posts: 1

Participants: 1

Read full topic

Viewing all 17068 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>