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

Admob ads not showing in Huawei Devices

$
0
0

@jeevs wrote:

Hello All,
I am facing really weird issues. I am using latest version of SDKBOX/Admob, cocos engine version 3.17.2 c++.
Ads are showing in Samsung devices for Android and in iOS Simulator too but Ads are not showing in Huawei devices.
These types of errors are shown:
E Ads : Google Mobile Ads SDK initialization functionality unavailable for this session. Ad requests can be made at any time.
I Ads : Ad failed to load : 3

Can anyone tell me what’s going on?

Posts: 3

Participants: 3

Read full topic


Build debug spider monkey for cocos2d 3.17.1

$
0
0

@thaihoangduylinh wrote:

I want to debug deep into spider monkey on cocos2d 3.17.1, but I don’t know spider monkey version that it’s using and how to build spider monkey. Can anyone help me, Thank

Posts: 1

Participants: 1

Read full topic

Built-in Nodepool vs Custom Node Pool

$
0
0

@ancomchancanh wrote:

Does the built-in nodepool do special thing “behind the scene” to optimize performance of game?
I see it complicated to use, so Im using my custom node-pool implementation.

But I still wonder if the built-in nodepool has some magic power that I need to reconsider to use it?

Posts: 1

Participants: 1

Read full topic

Tutorial: Submitting a pull request to Cocos products

$
0
0

@slackmoehrle wrote:

How to submit code to Cocos

Like Cocos2d-x, Cocos Creator is also an open source game engine. This includes our code, examples and documentation, are open source.

In the process of developing your game, when you find that the engine, documentation, or examples are not perfect, if you only make suggestions to the official team, the official team may not be able to follow up in time due to limited human resources. We welcome all users to actively submit pull requests (PR) to help Cocos get better and better. Does the engine have a bug? Submit a PR! The sample is ugly? Submit a PR! API comments are not clear? Submit a PR! Is there a typo in a document? Submit a PR! Want to contribute your valuable changes to the gaming community? Submit a PR! Are you beginning to notice a pattern? We welcome submissions to further progress Cocos products.

The following are commonly used open source repositories, which can accept PR’s:

Let’s take a look at how to submit code to Cocos on GitHub from scratch.

Prerequisites

Sign up for a GitHub account

Browse to GitHub to sign up for an account or login with your already existing account.

Review GitHub basics

It is important to review the basics of using GitHub. It would be a lot to cover every topic in a single tutorial.

Understand basic GitHub terminology

There are some basic terms that every developer working with GitHub should know. These definitions are taken directly from GitHub’s documentation.

  • GitHub - GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

  • Repository - A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets – anything your project needs.

  • Branch - Branching is the way to work on different versions of a repository at one time.

  • Commit - On GitHub, saved changes are called commits. Each commit has an associated commit message, which is a description explaining why a particular change was made.

  • Pull Request - Pull Requests are the heart of collaboration on GitHub. When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch. Pull requests show diffs, or differences, of the content from both branches. The changes, additions, and subtractions are shown in green and red.

  • Merge - When a pull request is joined in with the code of a branch. Thus making it part of that branch for others to work with.

  • Origin - the location of the repository that contains the code to be worked it.

  • Fork - a personal copy of an origin repo.

Installing Git - command-line

Git needs to be installed on your computer. If it is not already installed you must obtain the Git software and install it. Some resources can be found on git-scm and this gist. Once installed, entering git on the command line should produce the following:

You are now ready to begin using Git. There are other tools you may want to consider, especially if your command-line chops aren’t quite stellar yet.

Installing Git - GitHub Desktop

GitHub Desktop is a GUI application for working with Git Repos and it is made by the folks at GitHub. You can use your existing GitHub credentials. Download it and install it if you wish to use it. It is east to get started, just launch the app and follow the prompts.

Working with Cocos Creator and GitHub

Now that you have reviewed the basics and decided if you will be using the command-line or GitHub Desktop we can work with the Cocos Creator Docs repo. It is important to first view this repo on GitHub.com so you can see what this interface looks like. You will need to use this interface for a few operations (i.e forking a repo, covered later).

Cloning repositories

The first step in most situations is to clone the repository of the project you want to start contributing to. We will use the Cocos Creator Docs repo as our example throughout this process.

Command-line:

# clone the Cocos Creator docs repo to some location on your hard drive
# that makes sense to you.
git clone https://github.com/cocos-creator/creator-docs

# change to the Cocos Creator docs directory, where ever you put it.
cd /Users/s-m/creator-docs

The output looks something like this:

GitHub Desktop:

It is easy to clone with the following screenshots:

When you click Clone, you will see a progress screen:

Once the repo is cloned, you can begin working with it.

Forking repositories

Forking a repo means that you take a copy of an existing repo and it appears under your GitHub account. You fork a repo so that you can make changes to it. These changes are isolated away from the projects repository that you cloned. You can experiment with code changes, help fix typos, anything you wish to help with. You need to use the GitHub Web Interface to fork a repo.

Once forked, you will see a new repository has been created that references the original project:

You can either use the command-line or GitHub Desktop to work with the forked repo.

Command-line:

On the command-line you can simple add a new remote location. This tells GitHub where the origin repository is and where your forked repository are. This allows your fork to pull updates and submit pull requests to the origin repository. Here is an example:

# cd into the directory where you cloned the project
cd /Users/s-m/creator-docs/

# show current remote locations
git remote -v

# add a remote repo replace 'MyForm' and '<your github id> with proper values
git add remote MyFork https://github.com/<your github id>/creator-docs

# now re-run git remote to see this change has occurred
git remote -v

Here are a few screenshots to demonstrate the output of these commands:

GitHub Desktop:

Using GitHub Desktop you still need to fork using the web interface, using the same instructions above. You can always get to the web interface for a repository from GitHub Desktop:

Once you have forked, you can quickly get into GitHub Desktop to start working with your fork:

Back in GitHub Desktop we can see and use the forked version to start making changes to submit back to the origin.

Making changes (by branching first)

Before you start making changes, it is appropriate to cut a new branch to perform your changes in. This gives you a working playground that doesn’t affect the master branch. If your changes don’t go your way you can simply delete the branch and cut a new branch from master again and try again.

Command-line:

# cut a new branch from master to perform changes
git checkout -b MyNewBranch

# checking which branch you are currently on
git branch -v

GitHub Desktop:

Pulling changes from origin

When making changes, it might be necessary to pull any new changes that have been merged during your development time. When you submit a pull request GitHub will tell you if it can be merged successfully. If it cannot, GitHub will require you to pull changes from the origin and fix any merge conflicts. It may be beneficial to pull often to ensure merge conflicts are fixed along the way. To pull:

Command-line:

# pulling from origin
git pull origin master

GitHub Desktop:

Pushing changes to origin via a Pull Request

It is a good idea to commit and push your changes to your remote repository often. This secures them up in the cloud for safe keeping.

Command-line:

# check the status of a repo
git status

# checking which branch you are on
git branch -v

# adding all changed or untracked local files to git
git add .

# adding specific changed or untracked local files to git
git add en/getting-started/history.md

# committing all changed files to GitHub
git commit -m 'I changed these files' .

# committing specific changed files to GitHub
git commit -m 'I changed these files' en/getting-started/history.md

# pushing committed changed up to GitHub
git push -u <remote repo name> <branch name>

GitHub Desktop:

You can commit and push as often as you wish. Once you are satisfied with your work, it is time to create a pull request.

Creating a pull request

Creating a pull request is your way of telling the origin project that you have made changes you want to be considered for merging into their project. When creating a pull request, it doesn’t matter if use the command-line or GitHub Desktop, it is down from within a browser window. In fact, GitHub Desktop will open a browser window automatically for you.

Once in the browser, follow the prompts to create a new pull request. It is always good to verify that your pull request is being merged with the correct origin branch and that the changes you made all seem to be there. If something is missing you may have forgotten to add, commit or push changes to the remote repository.

After creating the pull request, it can be edited, have additional commits and developers can even talk about the work you submitted.

Additional considerations

There are a few things developers may want to consider that are outside the scope of this tutorial.

SSH versus HTTPS

GitHub offers both SSH and HTTPS protocols for working with repositories.

Please review SSH vs HTTPS. It might also be helpful to review using SSH Keys and incorporating them into your workflow.

Posts: 2

Participants: 1

Read full topic

Cocos creator crash on device Xiaomi Redmi

$
0
0

@blo0dvn wrote:

my app crash randomly on XiaomiRedmi Note 5 Pro (whyred) , Redmi Note 7 (lavender) and ZTE B2017G (tulip)

NDK r16b

android version 9 and 8.1

Creator version?(2.0.9)

app link:


********** Crash dump: **********

Build fingerprint: ‘xiaomi/lavender/lavender:9/PKQ1.180904.001/V10.3.5.0.PFGMIXM:user/release-keys’

pid: 30814, tid: 31058, name: V8 WorkerThread >>> td.bagato.studio <<<

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x77f131d000

Stack frame #00 pc 000000000001e088 /system/lib64/libc.so (memcpy+280)

Stack frame #01 pc 0000000000f919a8 /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::internal::Scavenger::ScavengeObject(v8::internal::HeapObject**, v8::internal::HeapObject*) at :?

Stack frame #02 pc 0000000000f925c4 /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::internal::IterateAndScavengePromotedObjectsVisitor::VisitPointers(v8::internal::HeapObject*, v8::internal::Object**, v8::internal::Object**) at :?

Stack frame #03 pc 0000000000f91424 /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::internal::Scavenger::Process(v8::internal::OneshotBarrier*) at :?

Stack frame #04 pc 0000000000d94e68 /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::internal::ScavengingTask::RunInParallel() at :?

Stack frame #05 pc 0000000000d94c30 /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::internal::ItemParallelJob::Task::RunInternal() at :?

Stack frame #06 pc 0000000000445e9c /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::platform::WorkerThread::Run() at :?

Stack frame #07 pc 000000000043c080 /data/app/td.bagato.studio-vCa7e4xAe_iFbWrf-Ob13g==/lib/arm64/libcocos2djs.so: Routine v8::base::ThreadEntry(void*) at :?

Stack frame #08 pc 0000000000090328 /system/lib64/libc.so (__pthread_start(void*)+36)

Stack frame #09 pc 0000000000023a28 /system/lib64/libc.so (__start_thread+68)

Crash dump is completed

Posts: 1

Participants: 1

Read full topic

Open web build on phone

$
0
0

@Orlan wrote:

Hi there,

I created a Web Mobile of my project and I want to test it on my phone without the need to push it to a server at first. Is there a way to achieve this?
I thought of something like using my laptop as a server in my local network and connect to it with my phone, but unfortunately I never have done something like this before and I couldn’t find an useful answer on the web so far.

Best regards

Posts: 5

Participants: 2

Read full topic

Learn how Cocos Creator is being used on Facebook as we Interview Gameloft

Nested Scroll view in cocos creator

$
0
0

@RonnieBits wrote:

I wanted to use a horizontal scroll view inside a vertical scroll view to achieve the layout as shown in this image here :

I was able to produce this layout but while scrolling I’m having issues.

Issue : While scrolling vertically on the child (horizontal scrollview) its only registering for the child and blocking it to transfer to parent.

I want to transfer vertical scroll on the child to the parent(Vertical Scrollview). Any help on how to achieve this ?

Posts: 1

Participants: 1

Read full topic


How to pass an integer from java to C++ with JNI??

$
0
0

@doom_monsta wrote:

So I’ve stored this integer in global variable “newValue” in AppActivity, I’m just trying to figure out the C++ code to retrieve that value and be able to pass it into a function? Can you guys give me the simplest, most dumbed down answer? I’m new to C++ and cocos so I’m amazed I was able to get a character to move around on screen.

Posts: 1

Participants: 1

Read full topic

[RELEASED GAME][iOS][ANDROID][AMAZON] - Bipolar Ball

2nd camera stops touch events working

$
0
0

@akindamagic wrote:

Hi Guys, I have been building a project with a colleague, we are oceans apart and have built 2 sections of a single game without really talking to each other much… When i merged to 2 parts together, the touch events stop working in his section of the project. Upon debugging, i notice that A: if i remove his camera from his root node (it is a prefab which my section of the game spawns at the right time) then the touch events work again. If i remove my camera, which is in the canvas node, it appears at first that it is deleted but as soon as i view a prefab and then go back to the root canvas, my camera has magically appeared again.

My questions are as follows.
A: Is it possible to have 2 cameras in a single game. The one attached to the canvas which appears to be impossible to remove does nothing, the one in a prefab does all the correct camera movements etc?
B: why cant i remove the camera from the canvass node?
C:Why would touch events stop working if there are 2 cameras?

Thanks in advance :slight_smile:

Posts: 1

Participants: 1

Read full topic

BoxCollider manually

$
0
0

@C_Stefano wrote:

Hi!
We have two object A and B and these objects have inside a BoxCollider script.
Is it possible, when we want, verify these boxcollider when intersect between them? for sample in a cicly for; for(var i = 0; i < objects; i++) etc… because we move (without physic) an object and we want verify the collision with others objects when we move them.

Thanks for help! :slight_smile:

Stefano

Posts: 7

Participants: 2

Read full topic

[Game] Mazes and Mages 2

$
0
0

@Juanjo wrote:

Hi, I just released Mazes and Mages 2 on Steam, using cocos2d-x.

Thanks a lot for this great engine =)

Posts: 1

Participants: 1

Read full topic

SDKBOX IAP onRestored(), when changing the system language

$
0
0

@dirtyshadows wrote:

Hello,
IAP works perfectly, only when factory reset Android device and change the system language
onRestored() function does not see the order. At the moment of the test account, I have two orders from one account. I guess for play.google these are two different devices. But has anyone had this problem?

Posts: 1

Participants: 1

Read full topic

iOS 13 ipad bug


Exception thrown: read access violation.this->_epsilonLabel was 0xCDCDCDCD.

$
0
0

@VeniVi_DiVici wrote:

I’m setting up cocos2d-x [3.17.2], using Visual Studio Community 2019 on Windows 10, Python is setup correctly, cocos runs in the terminal if I invoke the command.

When I begin cocos2d-win32.snl it asks me to retarget my solution, I retarget. I compile cpp-tests and it doesn’t have any errors but it does have a 320 warnings in total and 18 messages about the warnings.

I run CPP-Tests and it crashes once I select the right green arrow on '2: Sprite Polygon Creation with a rect" I’ve included two images with some error codes. I’ll totally provide more information as needed, I’ve searched for this on google, I just can’t seem to find any information and I’m kind of at a loss. What should I do from here?

Thanks! :smiley:

(upload://4IRfwLBerqIpzxKBPqR0lUNOJl0.png)

Posts: 1

Participants: 1

Read full topic

Hello and thanks so much, question regarding to resolutions..

$
0
0

@digimikeh wrote:

Hi!.. Thanks to trust me and allow me to post…

I´m starting with Cocos, i like the way i can use it…, however it is the first time i´m trying to develop 2D games, so i´m currently dealing with resolutions… i mean, i still don´t understand the window viewport, it is a camera that can pan over the bgs and sprites? or do all the childs need to move themself to be showed on the viewport? I came from 3D, and camera were too easy to understand, but in this way, i´m in blank …

Regarding to resolution, i don´t know if my png files (for sprites and bgs) need to be according to the window size… for instance, i´m trying to put a 4096 x 1024 BG on a 1024x768 window viewport, but my bg is giant, i only see a very little portion of it…

Thanks in advance!
Cheers.

Posts: 1

Participants: 1

Read full topic

How to make a dynamic rigidbody not move

$
0
0

@DcCoO wrote:

I have an object with a dynamic rigidbody, and all I want is that when something collides with it, it won’t move. If anything collides with it now, it moves but I want it to be stopped. I tried to increase the density and the linear damping but nothing worked.
I can’t make it a kinematic rigidbody because I still want it to detect collisions with other objects that are already kinematic (and I found out that 2 kinematic objects don’t collide).
How can I make a dynamic rigidbody not move with contact?

Posts: 3

Participants: 2

Read full topic

Tilemap drawing/loading/dividing

$
0
0

@Roout wrote:

I need a seamless transition from one room to another room. I have 2 approaches in my mind for now:

  1. Level consist of several rooms and each tilemap is a room.
    Player touch certain zone on active room (room where player is now). As result new neighbor room is drawn next to the current room so player can see both rooms at the same time. Personally I see this approach too abrupt and edgy for the player’s perception. Am I wrong?
    For now I’ve just tried similar approach but with modification: For each room I added object (spawn for player) near transitions between rooms. So when player step on the boarder of the room, next room will be drawn and the player will appear at the object position near this transition but already in the neighbor room. To sum up I’ve just drawn new room instead of previous one and placed player at the appropriate position. In this case I can say with certainty It’s really too absurd and sudden appearance of the new map. Disappearance of the previous one has the same problem. So I crossed this choice.

  2. Unite rooms into one level. So level is a single large tilemap ( e.g. 128 x128 ) and I think this should be enough for me.
    Here go some questions:
    2.1. Is there any way to draw only choosen tiles (e.g. square 8 x 8 with player at the center)?
    2.2. Are tiles being drawn outside the visible part of map? Maybe they are being culled and I don’t even need to worry about the question 2.1?
    2.3. What about performance? will be any issues with such huge map?

Also any actual tutorials? I’ll be glad to see some info about the subject above.

Do you have any advice?

Thanks for reading this.

PS: cocos2dx 3.17; Tiled 1.2;

Posts: 1

Participants: 1

Read full topic

cocos2dx android emulator Device supports x86)64,x86, but APK only supports armeabi-v7a

$
0
0

@gustxw wrote:

hey guys im on cocos2dx android trying to run the project on android studio with windows 10 but on the list of emulators it says that only supports armvi7 for my 2 emulators i tried installing a new emulator that one also has the same problem what can i do to solve this?

Posts: 2

Participants: 2

Read full topic

Viewing all 17117 articles
Browse latest View live


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