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

physicBoxCollider-node moved runAction sometime ignore collision?

$
0
0

@ancomchancanh wrote:

Anyone has experience handling a physicBoxCollider-node character - being moving with runAction() - that SOMETIME doesn’t wake up when hitting another physicBoxCollider-node?
(sometime it wakes up but sometime goes directly through the same object)

I dont know how the engine handle 2 different moving trends (ccAction vs physic) applied to a single node
Please anyone can explain me the mechanism behind?

Posts: 1

Participants: 1

Read full topic


Need to load image from SpriteFrameCache ( plist files ) with RichText::createWithXML function

$
0
0

@dragon0962 wrote:

Hi all,

I need a feature for RichText::createWithXML function regarding loading image !

Can we add attribute textureResType (local or plist ) in <img /> tag ?

Ex:

auto _richText = RichText::createWithXML("you should see an image here: <img src=‘cocosui/sliderballnormal.png’ textureResType=‘plist’ /> ");

And I found a bug in RichElementImage::create(…, ui::Widget::TextureResType::PLIST) function .

As you know , the image in PLIST file was not loaded. Can we fix it in V4 ?

Thanks !

Posts: 1

Participants: 1

Read full topic

Sudden problems running my game on Windows (cocos2dx 3.16)

$
0
0

@dogwalker wrote:

Two players, including a beta tester who has been testing my new version for over a month, have emailed me separately that suddenly my game won’t launch for them. In fact, all of a sudden none of my existing three versions will run. I would assume video drivers, but both have updated. In fact, the one user had updated his drivers before getting this error.

Fortunately (?), I had a problem running them on my wife’s laptop, and I got the 2019 and 2020 versions to run, but it doesn’t help either of the other two guys. Pretty strange solutions, too. 2019 now runs if you turn off Steam Cloud, and for 2020 to run, I had to turn off a Steam function and my call to AudioEngine::lazyInit().

However, like I say, those two still can’t run my game, which makes me extremely hesitant to release the new version.

I’m still on cocos2d-x 3.16, so I’m wondering if it’s worth the effort to try to kludge the newer glew and glfw from 3.17 into my project, or even try to move to cocos2d-x 3.17? I’m at a loss here, and it’s killing me.

thanks

Posts: 1

Participants: 1

Read full topic

Mask screen adaptability issue

$
0
0

@Mamoxinch wrote:

Hello, I set up a sprite and it’s mask in the ensuing manner:

	Sprite = Sprite::create("sprite.png");
	Sprite ->setPosition(visibleSize.width / -30 + origin.x, visibleSize.height / -1.12 + origin.y);
	Sprite ->setScale(visibleSize.width / 1530, visibleSize.height / 1200);
	//
	masknode= ClippingNode::create();
	
	
	mask= Sprite::create(cover);
	mask->setPosition(visibleSize.width / -9 + origin.x, visibleSize.height / -1.09 + origin.y);
	mask->setScale(visibleSize.width / 2400, visibleSize.height / 1400);
	mask->setRotation(90);

	masknode->setStencil(mask);
	masknode->setInverted(true);

//...
	Node->addChild(masknode);

The sprite’s position and scale is fine, I have observed it as an .exe and on a mobile device. Sprite is adaptable.

On the other hand, the mask, which is sufficient size and position on the .exe, is slightly less sufficient on the mobile device. Sprite is hidden perfectly on .exe, however slightly showing on the mobile device. How can I make the mask adaptable for all phones, I scaled and positioned it in a way most adaptable assets are positioned and scaled.

Posts: 1

Participants: 1

Read full topic

Powered by Cocos Creator, Ekans is one of the WeChat Creative Mini Game

Reacting to Dark Mode for ios 13

$
0
0

@kerryk wrote:

Hi! I want my cocos game to react to dark mode change on ios 13 like the following video:

I noticed that when i change ios 13 dark mode on/off, cocos will not react to changes and draw until all native ios screens in front are removed. The reason is because the app correctly checks in CCDirectorCaller-ios.mm if the app is active before drawing.

18%20AM

If i remove isAppActive check, the issue is fixed but i guess it is potentially dangerous for crashes. What if I change the check to become inactive from UIApplicationWillResignActiveNotification to UIApplicationDidEnterBackgroundNotification? This will allow the app to draw in more cases but still pause on background. Is it safe? Is app allowed to draw if UIApplicationWillResignActiveNotification is called but not UIApplicationDidEnterBackgroundNotification?

willResignActive - Can app still draw?
didEnterBackround - App CANNOT draw here 100%.

Also is there a way to make cocos draw a single frame?

@zhangxm i guess u will know the answer )

Posts: 1

Participants: 1

Read full topic

physicCollider - onPostSolve() contact.getImpulse() not work

$
0
0

@ancomchancanh wrote:

I’ve tested many times to find out contact.getImpulse() will always return

{
     normalImpulses: cc.v2(0,0),
     tangentImpulses: cc.v2(0,0)
}

Is this a feature or a bug?
I need to get the impulse casted to a rigidBody in a physic-collision to see if it node should be broken.

Anyone experienced this?
I’ve found that no one asked this in this forum as well as Google. How weird!

Posts: 2

Participants: 1

Read full topic

Global Font Selection for i18n in Cocos Creator

$
0
0

@RonnieBits wrote:

When player switches to another language(even if local) accordingly all the labels should use the global font to support local language font

This feature would be greatly helpful while using i18n. Is this feature available in latest Cocos Creator Version(v2.1.2) ?

Posts: 1

Participants: 1

Read full topic


Happy Chinese Mid-Autumn Festival!

Problem with cocos2dx 3.17.2 c++ Android

$
0
0

@jeevs wrote:

Classes/AppDelegate.cpp:132: error: undefined reference to ‘SettingsLayer::createScene()’
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

I was trying to upgrade my project to version 3.17.2 c++, I’m getting these errors.
SettingsLayer is the first screen I have to launch in my game. I have put SettingsLayer.h header in the include AppDelegate.cpp. It works in iOS version with XCode but it’s not working in Android Studio and cocos console command line both.
Please help!!!

Posts: 1

Participants: 1

Read full topic

Using RPATH for external libraries with CMake and Cocos2d-x

$
0
0

@M4713 wrote:

I’ve encountered a serious roadblock trying to use Steam API (libsteam_api.so) with my Cocos2d-x 3.17 project when building on Linux.

According to the documentation supplied by Steam, I have to link steam_api library to my project as well as supply the .so file with the executable, but on Linux executable’s directory isn’t searched for shared libraries by default.

Searching various forums, I found out this is supposed to be solved setting “$ORIGIN” rpath during link time. This is where it gets problematic with Cocos2d-x.

When I run readelf -h on the executable built with Cocos2d-x 3.17 CMakeLists.txt, I noticed something very peculiar. Relevant output line is:

Type: DYN (Shared object file)

This is a bit puzzling to me, I expected to see:

Type: EXEC (Executable file)

This is not the most troubling thing as the file can still be executed just fine, but I would like to know if there’s some setting in Cocos’ CMakeLists.txt or anywhere else that I could change to make the output type EXEC.

I’ve tried various commands I found in the CMake docs when trying to make this work, among other things:

set(CMAKE_BUILD_RPATH_USE_ORIGIN true)
set_target_properties(${APP_NAME} PROPERTIES CMAKE_BUILD_RPATH "$ORIGIN")
set_target_properties(${APP_NAME} PROPERTIES CMAKE_INSTALL_RPATH "$ORIGIN")

None of them worked. Trying to run the app, I got following error message every time:
libsteam_api.so: cannot open shared object file: No such file or directory
And the relevant .so file was sitting in the same folder, next to the executable.

When trying to inspect the actual rpath used with readelf AppName -d | grep path, I got:

0x000000000000000f (RPATH) Library rpath: [/opt/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit]

Now this seems really strange to me, it appears some sort of Cocos2d-x’s inner workings already set this rpath (to accommodate libraries that cocos uses I guess?).

First question: I think I need to somehow append $ORIGIN to this path list: How?

Second (way more disturbing) question: If this rpath is set to some external library that cocos2d-x uses, the end-user of my application (who obviously isn’t going to have cocos2d-x engine installed on their machine) will most likely get an error message. How do I prevent this? How do I “bake-in” whatever cocos2d-x uses (in particular this fmod, whatever that is) into what I ship?

Posts: 1

Participants: 1

Read full topic

Discounted Udemy courses!

$
0
0

@slackmoehrle wrote:

Hello Everyone,

We are happy to announce that we have worked with @kasweshi to offer everyone discounted prices on his wonderful Cocos Creator courses. His tutorials are high quality and he teaches in a way that is understandable to every level of Cocos Creator developer. We are very happy to have him creating tutorials.

This first course if for new developers who want to get around with Cocos Creator.

This second course gives an example of how to create a simple endless runner type of game.

https://www.udemy.com/course/create-a-2d-endless-runner-game-with-cocos-creator/?couponCode=KASWESHI

There is a third course, pending Udemy review, that demonstrates how to make a 2D space shooter. We will update the post once it is available. We hope that everyone enjoys these classes!

Posts: 2

Participants: 1

Read full topic

Nintendo Switch Port Partner?

$
0
0

@corytrese wrote:

Does anyone out there work for a studio that does ports to the Nintendo Switch for Cocos2d-X games written in v2.1.6

Or, have you worked with a third party partner that has successfully ported your Cocos2dx game to the Nintendo Switch. I’d really like to find someone that has already ported at least one v2 C++ Cocos2dx game to the Switch.

My email is cory.trese@gmail.com if anyone wants to chat about this.

Posts: 2

Participants: 2

Read full topic

Cocos Creator and Spine

$
0
0

@mikeb wrote:

I haven’t seen anything on the roadmap for updating Cocos Creator to work with the latest Spine files. I guess the Spine team updated the JSON format and they’ve suggested reaching out to your team to see if you could update stuff on your end. I’m not too sure what is required, but one of their team members had this to say:

They can simply fetch our latest sources for spine-cpp from our 3.8-beta branch and integrate it with their Cocos Creator code base.

Thread here: http://esotericsoftware.com/forum/Error-export-spine-to-Cocos-12076?p=53987&hilit=cocos+creator#p53987

Posts: 1

Participants: 1

Read full topic

Add Background Music Cocos2d JS

$
0
0

@Roda1006 wrote:

I have 2 file , game.js and gamemanager.js .

In gamemanager i have in res

res.bg_slike = 'slike/bg.jpg';
res.floor_slike = 'slike/floor.png';
res.goku_slike = 'slike/goku.png';
res.oblak_slike = 'slike/Oblak.png';```  

and in game.js  i function and other things 

So can someone help me how can i add background music what i must write in res (i want take music from folder) and what in game.js  ??

Posts: 1

Participants: 1

Read full topic


Apply different restitution rate on physics collider

$
0
0

@PaPiPuGames wrote:

I’m using physics (Rigidbody and collider) at Cocos creator.

I want to apply different restitution rate when collider hit different type of object.
What will be the smart way to do that?

Thanks.
-Hiroki

Posts: 1

Participants: 1

Read full topic

List of games created with Cocos2d-x

Rummy Mobile for Android

Strange issue in Android Studio

$
0
0

@code_doc wrote:

I am long time unity developer and I wanted to port my games to cocos2dx. I created a project and launched cocos2d-x in Android Studio v.3.5 and When ever I add new cpp class I am getting issue Can’t Resolve Container cocos2d. HelloWorldScene seems to load cocos class fine . Even if I duplicate and rename Class I am getting same issue.

Am I missing something like importing libraries or some declerations ? I am attaching screenshot of my problem.

Posts: 4

Participants: 2

Read full topic

Cocos creator project safari issues

Viewing all 17117 articles
Browse latest View live


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