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

Dragon bones animated character

$
0
0

@vaikash wrote:

Hi, I am trying to implement collision detection for animated character (done using Dragonbones). I need to access to bones and joints data (position, etc.) each frame so as to achieve near pixel perfect collision detection. Is there a way to do it through code?

Thanks

Posts: 1

Participants: 1

Read full topic


Cocos RichElementText mis aligned inside RichText if enableRetina true on mobile browser

$
0
0

@suhaspatil wrote:

I am using Cocos2d-JS 3.13.1, on game start I am calling cc.view.enableRetina(true) . But, due to this, ccui.RichElementText inside ccui.RichText is mis-aligned.

misaligned screenshot:

If I set cc.view.enableRetina(false) , cocos renders blurred fonts.

Blurred fonts screenshot:

This is happening only if I compile cocos for web and not reproducible if compiled for Android.

Any solution for this?

Posts: 1

Participants: 1

Read full topic

Can't compile release when add SDKBox Facebook

[Editor bug] Suddenly disable all widgets

$
0
0

@BugsKiller wrote:

When I copy/paste a component in editor, all the widgets of visible nodes in current scene are disable. It happened twice to me. This is quite annoying because I have to find and enable each of those widgets again. CC 1.9.3.

Posts: 1

Participants: 1

Read full topic

[BUG] Low resolution on facebook insant games with 2.0.1 (mobile only)

$
0
0

@kreys89 wrote:

Hello there,
we are just starting a new project for Messenger, and we’ve moved from 1.9.3 to 2.0.1. Everything seems fine, despite one thing.

Web build opened locally and on mobile browser seems ok.
Facebook instant games build opened on desktop browser is ok.
Facebook instant games build opened on mobile with Messenger app is totaly low resolution and blurred. Printing cc.view.getCanvasSize() gives results of 393 x 738, and it is opened on phone with 2160x1080 resolution (and should be somehow close to this number).

Is it a Cocos Creator bug?

I have tried different design resolutions, fit to width / height options, nothing helps. The same thing is on a clean empty project, see image below:

Facebook Instant Games on mobile Messenge (WRONG):

Local build (OK)

Facebook Instant Games on desktop browser (OK):

Is this a problem that you are aware of? Any workaround?

Posts: 1

Participants: 1

Read full topic

UI clipping problem when reload Android openGL context

$
0
0

@pbs0512 wrote:

The test has clippingListView in the previous scene when multiple scenes are nested.
os is Android 8.0 and cocos2d-x version 3.15.
Continuing to click on the Android power button will recreate the opengl context.
Then move to the previous scene (there is a clipping Listview).
There is a bug where Listview childrens are not visible.

Posts: 1

Participants: 1

Read full topic

Error: "PluginSdkboxPlay/PluginSdkboxPlay.h" not found

$
0
0

@hexerror wrote:

I’m integrate SdkBox play in my project via CLI. In ios it compiles and work just fine, but in android, Android Studio compile stop with error:
fatal error: ‘PluginSdkboxPlay/PluginSdkboxPlay.h’ file not found
#include “PluginSdkboxPlay/PluginSdkboxPlay.h”

What could be wrong?

Posts: 1

Participants: 1

Read full topic

Cocos2x 3.15 with Androd Studio 3

$
0
0

@MuratAlbayrak wrote:

Hi,

I have to setup a new Workstation, so I want to use this oportunity to update Android Studio.
is it possible to use Cocos2dx Version 3.15 with Android Studio Version 3+.

Any experience?

Posts: 1

Participants: 1

Read full topic


Type more characters in one go in EditBox at Android phone

$
0
0

@hongleong32 wrote:

Hi, anyone know how to add more same character when user type any key on android keyboard?
example: user press and hold ‘k’
now only fire ‘k’ once.
Is there a way to fire more than once if user press and hold ‘k’ ?
i know browser can. but how about android phone?

want to be like ‘kkkkkkkkkk’ instead of just one ‘k’ in Editbox
without pressing multiple times on android keyboard.

Posts: 1

Participants: 1

Read full topic

Switch between 2 EditBox in android phone

Aspect ratio of 2:1 android devices design resolution help

$
0
0

@jusforfun wrote:

Hi all ,

Have been using cocos2dx and cocos studio to design layout of my game based on the aspect ratio of 16:9 and 4:3.

But recently have found that there are devices of aspect ratio 2:1… Is it a good idea to change my design resolution for 2:1 ?

Currently tried to test a few scenarios and find it that there are more areas getting cropped out on smaller aspect ratio devices;

Posts: 1

Participants: 1

Read full topic

drawNumberOfQuads crash on multiple OpenGl contexts

$
0
0

@kerryk wrote:

Hi guys! We get thousands of crashes in our app as follows:

01%20AM

I am in no way an expert in OpenGl and rendering but i believe the problem happens when multiple gl contexts are involved. We verified that this crash happens after playable rewarded videos appear on screen and are closed and cocos2d-x is trying to continue rendering. I guess this was also a problem of the past in this method:

-(void) doCaller: (id) sender{
if (isAppActive) {
    cocos2d::Director* director = cocos2d::Director::getInstance();
    EAGLContext* cocos2dxContext = [(CCEAGLView*)director->getOpenGLView()->getEAGLView() context];
    if (cocos2dxContext != [EAGLContext currentContext])
        glFlush();

    [EAGLContext setCurrentContext: cocos2dxContext];

    CFTimeInterval dt = ((CADisplayLink*)displayLink).timestamp - lastDisplayTime;
    lastDisplayTime = ((CADisplayLink*)displayLink).timestamp;
    director->mainLoop(dt);
}

}

As i see we check if current context is cocos2d-x and flush it before setting the context. Is there any other improvement that can be done in this function to safeguard it further?

  1. Will it make any difference using glFinish instead of glFlush?
  2. Will it make any difference to getEAGLView after the glFlush?

I am asking this becasue this fix was originated from https://github.com/cocos2d/cocos2d-x/issues/16873 in which the solution proposed was different:

-(void) doCaller: (id) sender
    {
    if (isAppActive) {
         cocos2d::Director* director = cocos2d::Director::getInstance();
        if([EAGLContext currentContext] != [(CCEAGLView*)director->getOpenGLView()->getEAGLView() context]) 
   {
        glFinish();
        
        [EAGLContext setCurrentContext: [(CCEAGLView*)director->getOpenGLView()->getEAGLView() context]];
    }
    
    director->mainLoop();
}
}

Any OpenGl/Cocos2d-x experts please help so that we can solve for good this issue.

Posts: 6

Participants: 2

Read full topic

How do I remove the deprecated function in 3.17?

$
0
0

@chumbyfuzz wrote:

I just created a new project with cocos2d-x v3.17.

When I build I get the following warning: “Implementing Deprecated Method” , in RootViewController.mm, line 87, for the function: didRotateFromInterfaceOrientation.

I am aware that it is just a warning, and can be ignored, but if there is a way to fix this warning, can someone tell me how to do so?

Thanks.

EDIT: I tried to create a more descriptive title, but for some reason the forum wouldn’t let me post it - it gave an error asking me whether my title was a complete sentence, thats why my question has the above title.

Posts: 6

Participants: 4

Read full topic

Stacking nodes: possible to apply transparency to background nodes?

$
0
0

@powerdroid wrote:

I would like to create nodes that overlap each other such that the foreground node has no transparency, but the background nodes and all items in them have a transparency applied programmatically (probably around a 75% transparency). Then also, is it possible to bring a node to the foreground and send the current one to the background and take away transparency from the one coming to the foreground and apply a transparency to the one going to the background?

Does anyone know if there a way to do this? I hope I’ve explained it properly.

Posts: 2

Participants: 2

Read full topic

Attaching a weigh to a node

$
0
0

@Musab wrote:

hi i have a node (black) similar to the picture and i want it to have some kinda weigh(red) in a place i want it to go back to the same angle if its angle changes its the black object is a rigidBody any ideas how can i attach something and hide it

Posts: 1

Participants: 1

Read full topic


cc.director.loadScene Freezes game when loading big scene

$
0
0

@Ronsku wrote:

Hi,

Are there any way of speeding up the cc.director.loadScene('...') when loading a big scene?

I do cc.director.preloadScene('...'); before loading the scene, but that only helps with the downloading of the assets that the scene require.

I think the freezing for a few seconds (longer in slower devices) is because of the scripting of setting up the scene.

Are there any way of pre-load these scripts and renderings so that you can switch to a scene that is both “pre loaded” and “pre rendered” so that when I switch scene it loads immediately?

image

Thanks :slight_smile:

Posts: 3

Participants: 2

Read full topic

Particle System doesn't work in cocos2d-x 3.17

$
0
0

@DarkSpace wrote:

Hi.

I migrated from cocos2d-x 3.15.1 to 3.17.

Now when I try to use particle system in my game I get black screen.

My code:

                auto textureCache = Director::getInstance()->getTextureCache();
                auto stex = textureCache->getTextureForKey( "particle.png" );
                if( !stex )
                {
                    stex = textureCache->addImage( "particle.png" );
                }

                auto emitter = ParticleSystemQuad::create("particle.plist");
                addChild(emitter, 2);
                emitter->setTexture( stex );
                emitter->setPosition( v.pos );
                emitter->setAutoRemoveOnFinish(true);

Why it’s hapen?

This is code has been worked on cocos2d-x 3.15.1

Sorry my English.

Posts: 7

Participants: 2

Read full topic

Cocos2d-x 3.17 Android crashes with NullPointerException in org.cocos2dx.lib.Cocos2dxHelper.runOnGLThread

$
0
0

@vkreal2 wrote:

Anyone have any clue on this null pointer? Getting bunch of them in Google console using 3.17. Thanks!

java.lang.RuntimeException: 
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:4897)
  at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:4915)
  at android.app.ActivityThread.access$1600 (ActivityThread.java:211)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1759)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:145)
  at android.app.ActivityThread.main (ActivityThread.java:6946)
  at java.lang.reflect.Method.invoke (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:372)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1404)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)
Caused by: java.lang.NullPointerException: 
  at org.cocos2dx.lib.Cocos2dxHelper.runOnGLThread (Cocos2dxHelper.java:109)
  at org.cocos2dx.lib.Cocos2dxAudioFocusManager.unregisterAudioFocusListener (Cocos2dxAudioFocusManager.java:122)
  at org.cocos2dx.lib.Cocos2dxActivity.onDestroy (Cocos2dxActivity.java:230)
  at android.app.Activity.performDestroy (Activity.java:6809)
  at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1169)
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:4875)

Posts: 1

Participants: 1

Read full topic

Detecting stuff outside of viewed area

Dynamic Mesh Batching

$
0
0

@solan wrote:

Hello,

I have question about MESH_COMMAND Batching. The function
void Renderer::processRenderCommand(RenderCommand* command)

has the following code:
if (cmd->isSkipBatching() || _lastBatchedMeshCommand == nullptr || _lastBatchedMeshCommand->getMaterialID() != cmd->getMaterialID())

If you see to the
MeshCommand::genMaterialID(GLuint texID, void* glProgramState, GLuint vertexBuffer, GLuint indexBuffer, BlendFunc blend)
you will find that it use glProgramState pointer when hash is calculated.

But this pointer is different for each MESH. Thus butching does not work for mesh even it has the same material as previouse in the rendering cycle.

Could you please confirm that, or I miss something?

Posts: 5

Participants: 2

Read full topic

Viewing all 17126 articles
Browse latest View live


Latest Images

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