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

I found a bug in the documentation


Permissible to port Cocos Creator 2.0.9 Mac to Linux?

$
0
0

@ckhoo wrote:

Hi.

My studio needs Cocos Creator 2.0.9 for Linux so that we can incorporate the tool into the build pipeline. This is a mandatory requirement from our client.

Is it permissible to create a Cocos Creator 2.0.9 Linux port using the Cocos Creator 2.0.9 Mac version as the basis?

It’d be great to have the Cocos 2D team weigh in on this.

On a related note, we’re happy to help the team add Linux support to the Cocos Creator project!

Thanks.

Posts: 2

Participants: 2

Read full topic

Space Pig Math [iOS, soon Android]

$
0
0

@gmayer wrote:

Hello cocos2dx-friends :slight_smile:
In March I released a passion project that I’ve been making on the side for quite some time.

Space Pig Math is an action game for practicing your times tables - up to 12x12 - with satisfying, visceral feedback and retro-inspired visuals and sounds. It was crafted with love, by a game-industry veteran (and dad), in the belief that in this age of technological marvels, there is no reason that practicing times tables can’t be genuinely FUN!

It’s currently for iPad, and soon for Android (thanks to cocos2dx!). I’m also currently rethinking my tablet-only decision - so you might find a phone version soon as well!

Game page: http://spacepigmath.com

I also did a developer interview for coco2dx, which you might enjoy :slight_smile:

thanks
Greg

Posts: 2

Participants: 2

Read full topic

Android cpp-tests - missing Resources

$
0
0

@gmayer wrote:

I’ve downloaded cocos2d-x 3.17.2, unzipped, and ran setup.py.

I opened tests/cpp-tests/proj.android in Android Studio (3.4.1)

I got an “Error configuring” very much like this post: https://github.com/cocos2d/cocos2d-x/issues/19293
I had to change
#PROP_BUILD_TYPE=cmake
to
PROP_BUILD_TYPE=ndk-build
in
gradle.properties,
like the post advises - then it compiled.

I’m not sure what I’m doing here to be honest - I’m completely knew to Android - but since that post is from January, this ought to be fixed by now.

Then, trying to run the test, I’m completely missing the stuff from Resources - I can see in Android Studio that I do not have an “assets” folder that it should have gotten copied into, and the first asset it tries to load (arial.ttf) it can’t find.
Sounds similar to this:

I would really like to get the tests to run. What do I have to change to get the Resources copied into the package?

Note that if I create a new project with cocos cmd line tool, the Resources for that do get added to the package, and I am able to run the placeholder app.

Thanks
Greg

Posts: 2

Participants: 2

Read full topic

How to change COCOS2D_DEBUG value

$
0
0

@IzzyJM wrote:

COCOS2D_DEBUG value is equal to ‘1’ in both debug and release builds for Android, and I think this will cause a lot of unnecessary code to be in my release build which I do not want. Is there a way to set this to ‘0’ or not define it like it does on iOS ? thanks for any feedback

more info:

Posts: 6

Participants: 2

Read full topic

How to protect the image in resource

Node with CustomCommand flickering on Android 4.4

$
0
0

@sheshmoshen wrote:

I have a class that subclasses Node.

I override the draw() method and implement onDraw and
pass that to the a CustomCommand to which I pass to the renderer.

I’m using glDrawArrays(GL_POINTS, 0, total_points)

It’s very weird, the moment I setVisible(true) on my custom Node.
It flashes in the beginning, and then I don’t see any flashes.
It’s like a one time flicker.

I’m drawing into a RenderTexture but even without it the flicker still occurs.

I’m using cocos2dx v3.17.1 and my test device is a Samsung Tab SM-T230NU.

Does anyone have an insight or a clue to what may be going on?

Posts: 1

Participants: 1

Read full topic

Physics fast forward calculation of time

$
0
0

@buggy_glitch wrote:

Hey guys,
I am fast forwarding physics by calling box2d step function multiple times in update using a for loop of 100.
I am getting the desired results but I need to calculate dt when the fast forward is on so that I can derive a timer similar to when the fast forward is not being applied.
Anyway to that?

Posts: 1

Participants: 1

Read full topic


Is it possible to read a file content from apk?

$
0
0

@netanalyzer wrote:

Hi

I use 3rd party libs as source code, which allow me to create sprites from *.svg files. This method work fine with my build for Win32 platform, but not with my Androin builds.
The main problem on Android occurs when I have to open, read and parse *.svg file.
All my *.svg files are placed in assets/res/ folder. May be I should place my *.svg files in some other location?!
What is the proper way to open and read a file within apk using Android NDK? Is it possible at all?
What options do I have? Why Android build system is so complicated and messy? :slight_smile:

As you can see below fopen is used to open “assets/res/pieceOne.svg” file with “rb” mode. After debug’s “step over” fopen fails and file handle is NULL.

Posts: 1

Participants: 1

Read full topic

Developer Interview: Takahiro Miyazawa

Online multiplayer game Urgent help needed

$
0
0

@josprachi wrote:

Hi I am working on a game where i have completed the client side of the game. now I want to load the game resources from a remote server also I want to use a database to store the game related data. I dont uderstand how to connect the game to the server to store and fetch the data. Also I want to make the game multiplayer like snake and ladders. I am not getting any supportive samples/resources to understand the code. Please help me
Thanks,
Josprachi

Posts: 4

Participants: 2

Read full topic

How to get correct vector for cursorPosition in Scenes that follow sprite

$
0
0

@rahoyo wrote:

Hi, I have a Scene that follows to a sprite (player) by using:

auto followTheSprite = Follow::create(m_box, Rect::ZERO);
this->runAction(followTheSprite);

that’s work fine, I also want the rotation of sprite point to mouse cursor, then I’ve added
an EventListenerMouse by:

auto mouseListener = EventListenerMouse::create();
mouseListener->onMouseMove = CC_CALLBACK_1(HelloWorld::onMouseMove, this);

in my HelloWorld::onMouseMove i wrote this

void HelloWorld::onMouseMove(cocos2d::Event* event){
	if (m_box) {
		EventMouse* mouseEvent = (EventMouse*)event;
		cocos2d::Vec2 tankPosition = m_box->getPosition();
		cocos2d::Vec2 cursorPosition = mouseEvent->getLocation();
		Vec2 diff = cursorPosition - tankPosition;
		float angle = atan2f(diff.y, diff.x)*(180/3.1416);
		m_box->setRotation(angle);
	}
}

this doesn’t work fine, at firts when the game is launched de initial point of my sprite is (640, 480), at this point the cursorPosition , it show me correct values to my opinion, I mean, the values range look fit the screen size :smiley: and the orientation of my sprite, point to mouse cursor, such as I spect, but, when the sprite start to move through the world, and it got away from start point, the sprite doesn’t point to cursor, and the values that I got from cursor are not sense for me, I should spect similar values to tankPosition but a got values like start lauch values, what I can think is, the values of cursor are relative to screen and not to the world, but I’m not sure if that’s right, and I’ve attempting to use Director::getInstance()->ConverteToGL(cursorPosition) , but the values I got are similar to cursorPosition without use ConverteToGL.

Posts: 1

Participants: 1

Read full topic

Build failed for arm target platforms

$
0
0

@netanalyzer wrote:

Hi

Finally I managed to create working apk for x86 only. Everything works fine.

But build for armeabi-v7a failed. I did not changed anything comparing to x86 build.
Detailed output:

C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/elements/ImageElement.hpp:0: error: undefined reference to 'vtable for svgdom::ImageElement'
C:/Users/selec/AppData/Local/Android/Sdk/ndk-bundle/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/Parser.cpp:232: error: undefined reference to 'svgdom::Transformable::parse(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'     
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/Parser.cpp:299: error: undefined reference to 'svgdom::Transformable::parse(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/Parser.cpp:315: error: undefined reference to 'svgdom::AspectRatioed::parseAndFillPreserveAspectRatio(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/elements/ImageElement.hpp:0: error: undefined reference to 'vtable for svgdom::ImageElement'
C:/Users/selec/AppData/Local/Android/Sdk/ndk-bundle/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/StreamWriter.cpp:82: error: undefined reference to 'svgdom::Transformable::transformationsToString() const'
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/StreamWriter.cpp:100: error: undefined reference to 'svgdom::AspectRatioed::preserveAspectRatioToString() const'
C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/jni/Classes/svgdom/StreamWriter.cpp:142: error: undefined reference to 'svgdom::Transformable::transformationsToString() const'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make: ***     [C:/Users/selec/Documents/Projects/CocosPrj/exogame/proj.android/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libMyGame.so] Error 1

In the upper messages it could be noticed:

  1. "undefined reference to ‘vtable for svgdom::ImageElement’ "
  2. " the vtable symbol may be undefined because the class is missing its key function"

So, I suppose the problem might be multiple inheritance here in ImageElement.hxx file:

#pragma once

#include "Element.hpp"
#include "Styleable.hpp"
#include "Transformable.hpp"
#include "Rectangle.hpp"
#include "Referencing.hpp"
#include "AspectRatioed.hpp"

namespace svgdom {
  struct ImageElement :
	public Element,
	public Styleable,
	public Transformable,
	public Rectangle,
	public Referencing,
	public AspectRatioed
   {
      void accept(Visitor& visitor) override;
      void accept(ConstVisitor& visitor) const override;
   };
}

Is there any additional steps to take in order to build my project for armeabi-v7a?

Posts: 1

Participants: 1

Read full topic

SdkboxReachability memory leaks

$
0
0

@cybergate wrote:

Full stacks:
0 libsystem_malloc.dylib malloc_zone_calloc
1 libsystem_malloc.dylib calloc
2 libobjc.A.dylib class_createInstance
3 libobjc.A.dylib +[NSObject allocWithZone:]
4 Sample +[SdkboxReachability reachabilityWithAddress:]
5 Sample +[SdkboxReachability reachabilityForInternetConnection]
6 Sample -[TrackingLocalStorage notificationReceived:]
7 Foundation __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_2
8 CoreFoundation CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
9 CoreFoundation ___CFXRegistrationPost_block_invoke
10 CoreFoundation _CFXRegistrationPost
11 CoreFoundation ___CFXNotificationPost_block_invoke
12 CoreFoundation -[_CFXNotificationRegistrar find:object:observer:enumerator:]
13 CoreFoundation _CFXNotificationPost
14 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:]
15 SystemConfiguration reachPerformAndUnlock
16 CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
17 CoreFoundation __CFRunLoopDoSource0
18 CoreFoundation __CFRunLoopDoSources0
19 CoreFoundation __CFRunLoopRun
20 CoreFoundation CFRunLoopRunSpecific
21 GraphicsServices GSEventRunModal
22 UIKitCore UIApplicationMain
23 Sample main.m:5
24 libdyld.dylib start

I think its related to this topic https://stackoverflow.com/questions/20652033/apples-reachability-memory-leak

Posts: 1

Participants: 1

Read full topic

Firebase Testlab support for cocos2dx games


Critical BUG in android sdkboxIAP (error: 7 item already owned)

$
0
0

@tribal wrote:

Here is a critical bug with latest sdkboxIAP plugin (2.4.3.3) on android with consumable items (virtual currency)!

I use sdkbox with setAutoFinishTransaction(false) and enableUserSideVerification(false) to check transaction validity on my server.
But sometimes I cannot invoke IAP::finishTransaction() because the application is lost internet connection / application was terminated / device is turned off / etc.

In such case, IAP bills the user for the item (a test purchase confirmation is sent to my e-mail), but the item is not consumed. The currency is not added to user’s account (meaning the onSuccess listener method is not being called).
When I try to buy the same item again, it fails with error code “7 item already owned”.

The item is explicitly defined as consumable in sdkbox_config.json. Since the item is consumable, using IAP::restore() neither IAP::requestUpdateTransaction() does not help, they return nothing.

So there is a huge problem with money disappearing and user just lose his money, and they will claim to support but I can’t check their payments.

So there is must be few functions in SDK like IAP::RestoreUnconsumedTransactions() to receive all unconsumed items ( via
com.android.billingClient.queryPurchases(BillingClient.SkuType.INAPP)
with their productID and purchaseToken

Also we need a function sdkbox::IAP::ConsumeProduct(std::string purchaseToken) that will invoke com.android.billingclient.api.BillingClient.consumeAsync() to consume this items.

Posts: 1

Participants: 1

Read full topic

How and where to set resolution policy to EXACT_FIT

$
0
0

@rsamrry wrote:

hi,
I want to know how and where in code can I set the cc.ResolutionPolicy to cc.ResolutionPolicy.EXACT_FIT. I tried the following in onLoad() of one of my scripts but this failed:
cc.ResolutionPolicy.apply(cc.ResolutionPolicy.EXACT_FIT);
please guide…
thanks!

Posts: 1

Participants: 1

Read full topic

Server communication and scheduler stops after being in the background

$
0
0

@Orlan wrote:

Hi there,

In my app I have communication with my server through both XMLHttpRequests and Websockets.

When the app is running in the background for a small amount of time and then I open it up again, it seems like all communication is stopped. The app itself loads properly, and I can switch scenes and anything, but my XMLHttpRequests and WebSocket messages are not sent, and I can’t listen for any messages from the server with my WebSocket.

Also, my scheduled functions are not executed while in background. But I need to do that, as I have a timer which should always be running, even if the app is not opened.

Does anyone know why that is and how I can fix this?

Best regards

Posts: 1

Participants: 1

Read full topic

Template just for 1 property

$
0
0

@rsnggg wrote:

Hi everyone!

I want to create some interface for cocos creator, but list of my properties is too long and extension way doesn’t suit me.
So can i use template just for one property?

For example:

action: {
  minDelay: 1,
  maxDelay: 3,
  valueO: 200,
}

Cocos for default will show me this one like list. But I want to see it inline (like v3). But here is useless to use v3.
Exist template property just for 1 object or it easier to do using smth else?

Posts: 1

Participants: 1

Read full topic

to use admod in cocos creator

$
0
0

@pacear10 wrote:

Hello everyone, I want to use admod to show advertising, I follow the steps of this link

http://docs.sdkbox.com/en/qa/cocos_creator/

I run the application in the simulator and clicking on the buttons does not show the ad, install the application on an android device but it does not show anything and it does not generate an error either, work with coccos creator on mac.

Is there any other guide or way to do it?

Posts: 1

Participants: 1

Read full topic

Viewing all 17112 articles
Browse latest View live


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