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

Missing Purpose String in Info.plist File

$
0
0

@piotrros wrote:

Hi,
did anyone encountered following warning from the AppStore?:

Missing Purpose String in Info.plist File - Your app’s code references one or more APIs that access sensitive user data. The app’s Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn’t contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app’s code references one or more APIs that access sensitive user data. The app’s Info.plist file should contain a NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn’t contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

I’ve never get this warning before, but now I’m getting it with any game I update. I obsviously don’t use Location, because it’s a game :slight_smile: I’ve only saw some of pods are importing CoreLocation framework. I use the following Pods:

Using Bolts (1.8.4)
Using ChartboostSDK (7.3.0)
Using FBSDKCoreKit (4.37.0)
Using FBSDKLoginKit (4.37.0)
Using FBSDKShareKit (4.37.0)
Using Firebase (4.13.0)
Using FirebaseAnalytics (4.2.0)
Using FirebaseCore (4.0.20)
Using FirebaseDatabase (4.1.5)
Using FirebaseInstanceID (2.0.10)
Using Google-Mobile-Ads-SDK (7.35.1)
Using GoogleToolboxForMac (2.1.4)
Using OneSignal (2.9.3)
Using leveldb-library (1.20)
Using nanopb (0.3.901)

I’ve tried updating all of them with pod update, but it’s still the same warning. I CAN add these keys in plist file, but I cannot understand why should I, because I don’t even import CoreLocation in “my” project (except Pods as I said).

Posts: 1

Participants: 1

Read full topic


Using Arabic Text with a custom Font - Cocos2DX

$
0
0

@ArkaM wrote:

I have a use-case involving Arabic text in a game, with custom font. I am currently using the createWithTTF API call, and selecting the Font file that I would need.

However, since Arabic is a Right to Left(RTL) language instead of a Left to Right(LTR) language, the texts are getting printed incorrectly. Apparently, the best solution for this is to use the createWithSystemFont API call. However with this call, I would not be able to use a custom font and I would have to resort to a system font.

Is there any way that you guys know in Cocos2DX to use a custom font, with Arabic text? I did look into this Github issue(https://github.com/cocos2d/cocos2d-x/issues/15321). I tried the Arabic Writer(https://omar84.com/docs/taw/arabic_writer.html) out, but this gives glitchy output in certain cases. I know that editing the source JSON/Plist file is an option, and I have tried using reversed Arabic strings in the source. However, since Arabic is a language that has combined characters, the result that I get on my UI is not 1:1 with the expected result, and some characters are disjointed(which are supposed to form a special character after getting merged).I understand that Cocos does not have a proper Shaping Engine with FreeType font to get reversed Arabic texts work as they should, so are there any workaround to overcome this(Other than using SystemFont)?

Looking for suggestions on how to tackle this. I have looked into almost all open threads related to this, and could not find anything conclusive. Thanks!

Posts: 1

Participants: 1

Read full topic

ETC1 texture in spine animations

$
0
0

@Archimonde wrote:

Hello to all :raised_hand:
I want to use the ETC1 compression format for spine animations and improve performance on Android platform, but I can’t add an alpha channel to the texture.
A little search by code revealed the ability to attach a file with an alpha channel using the suffix “@alpha”.
I compress “sleleton.png” animations texture file using TexturePacker in 2 files - “skeleton.pkm” for RGB and “skeleton.pkm@alpha”.
Suffix great works with objects of the Sprite class(i use create() method), but does not work for “spine::SkeletonAnimation”. Tell me what to do and whether it is possible at all. Code below:

auto tmpSprite = Sprite::create(animDir + “skeleton.pkm”);
bg->addChild(tmpSprite);
tmpSprite->setPosition(center);

auto tmpSk = spine::SkeletonAnimation::createWithJsonFile(animDir + “skeleton.json”, animDir + “skeleton.atlas”);
tmpSk->setAnimation(0, “static”, true);
bg->addChild(tmpSk);
tmpSk->setPosition(center + Vec2(500, 0));

Posts: 1

Participants: 1

Read full topic

Native and Web platform

$
0
0

@ndmh wrote:

Hi everyone! I have an trouble with native android platform.My game on web platform is good but when i build android it really lag .I think something wrong with render .Can you give me some experience building for android platform.
Many thanks…

Posts: 1

Participants: 1

Read full topic

TypeError: Cannot read property 'clear' of null

$
0
0

@vivekEm wrote:

TypeError: Cannot read property 'clear' of null
1498
    at Object.genRenderDatas (C:\CocosCreator\resources\engine\bin\.cache\dev\extensions\spine\spine-assembler.js:114:29)
    at Object.updateRenderData (C:\CocosCreator\resources\engine\bin\.cache\dev\extensions\spine\spine-assembler.js:221:26)
    at RenderFlow._proto._updateRenderData (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\render-flow.js:89:29)
    at RenderFlow._proto._children (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\render-flow.js:117:38)
    at Function.render (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\render-flow.js:198:42)
    at RenderComponentWalker.visit (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\webgl\render-component-walker.js:146:28)
    at Object.render (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\index.js:125:34)
    at cc.Director.mainLoop.CC_EDITOR._purgeDirectorInNextLoop [as mainLoop] (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCDirector.js:441:26)
    at EditorEngine.tickInEditMode (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:2597)
    at EditorEngine._tick (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:5622)

This error is frequent. Please help in v2.0.9
@jare @slackmoehrle

Posts: 1

Participants: 1

Read full topic

Creating a label with SystemFont

$
0
0

@IzzyJM wrote:

I just realized I had been using “createWithSystemFont” in my game with a .ttf file, but everything is working as expected, is there anything different going on behind the scenes ? and should I change all my labels to createWithTTF ?

auto fourthlabel = Label::createWithSystemFont(“Level 1”, “fonts/Marker Felt.ttf”, 65);

Posts: 1

Participants: 1

Read full topic

Partial 'collision group change event' handling?

$
0
0

@ousaf wrote:

changing group emits the event


and handels here

which only handles Collision Components but I can’t see group change event handling in Physics Collider component

Am I missing something or there is partial handling of Group change event?

Posts: 1

Participants: 1

Read full topic

Collision Group changing not works

$
0
0

@ousaf wrote:

I have a node with PhysicsBoxCollider and changing collision group of node not take effect once the Node is created

I change collision group from following code
node.group = "collision_group_name";
It only effects the rendering properties of cullingMask but not effect the collision group in physics world

If I directly change the box2D fixtures collision filters then it take effect…

Node.getComponent(cc.PhysicsBoxCollider)._fixtures[0].m_filter.categoryBits = 4;
Node.getComponent(cc.PhysicsBoxCollider)._fixtures[0].m_filter.maskBits = 27;

I guess on changing collision Group with this code node.group = "collision_group_name"; only take care of rendering part but misses changing it in Box2D world

Posts: 1

Participants: 1

Read full topic


iOS cocos2d-x-2.2.6 'cctype' file not found

$
0
0

@useful wrote:

If you encounter an error:
//workspace/cocos2d-x-2.2.6/cocos2dx/support/tinyxml2/tinyxml2.h:38:13: ‘cctype’ file not found
1
You most likely have a warning that the stdlib library is missing.
The library was excluded in xCode 10+.
To do this, set the C++ Standard Library to libc++, both for your project and for the cocos2d-x project.
2 5
You will also need to set Enable Bitcode to No, for the cocos2d-x project.
3 4

Posts: 1

Participants: 1

Read full topic

When to send IAP receipt for validation with own server?

$
0
0

@Zinitter wrote:

Hi, i using sdkbox iap v2.4.3.3 with Cocos2d-JS.

I try to use my own server validation but wonder when should i send the IAP receipt.
Is it proper to send it on “onSuccess” callback because it will has some delay?

When i use sdkbox::IAP::enableUserSideVerification(false);, it doesnt has delay after the Apple IAP success popup and sdkbox stated it will verify the receipt with own server.

But as part of the above issue, when “onSuccess” is not triggered, is there any way i can get the IAP receipt manually so i can send for validation and complete the IAP?

sdkbox.IAP.setListener({
    onSuccess : function (product) {
        //Purchase success
        "send receipt to server for validation and complete the IAP"
    },
    onFailure : function (product, msg) {
        //Purchase failed
        //msg is the error message
    },
    onCanceled : function (product) {
        //Purchase was canceled by user
    },
    onRestored : function (product) {
        //Purchase restored
    },
    onProductRequestSuccess : function (products) {
        //Returns you the data for all the iap products
        //You can get each item using following method
        for (var i = 0; i < products.length; i++) {
            // loop
        }
    },
    onProductRequestFailure : function (msg) {
        //When product refresh request fails.
    }
});

In the guide http://docs.sdkbox.com/en/plugins/iap/v3-js/

the Handling Purchase Events only include above events in the listener, but i saw more events below.

I test on sdkbox.IAP.getPurchaseHistory(); but get error message “getPurchaseHistory is invalid on iOS”, is there any similar function on iOS?

onInitialized(success);

onRestoreComplete(ok, msg);

onShouldAddStorePayment(productName);

onFetchStorePromotionOrder(productNames, error);

onFetchStorePromotionVisibility(productName, visibility, error);

onUpdateStorePromotionOrder(error);

onUpdateStorePromotionVisibility(error);

onPurchaseHistory(purchases);

onConsumed(p, error);

onDeferred(p);

Thank you!

Posts: 1

Participants: 1

Read full topic

Change Animations with one Sprite?

$
0
0

@Darooooon wrote:

Hi, I’m working on a character with sprite and animations.

unique_ptr<Sprite> sprite;
map<string, unique_ptr<Animate>> animations;
...
animations["Idle"]->initWithAnimation(Animation::createWithSpriteFrames(frames, 1.0 / numImgs));
sprite->initWithSpriteFrame(frames.front());

What I did before was to create one Sprite per one Animation.

But I don’t want to create by Sprite::createWithSpriteFrame() cause of allocating Sprite per Animation(I thought it need more memory).

Is that code right way to re-use one allocated Sprite object? or use setSpriteFrame() ?

Posts: 1

Participants: 1

Read full topic

js prototype error, please fix

$
0
0

@oziphantom wrote:

so

@example
js
var v = cc.v2(10, 10);
v.div(5); // return Vec2 {x: 2, y: 2};
var v1;
v.div(5, v1); // return Vec2 {x: 2, y: 2};
*/
div(divisor: Vec2, out?: Vec2): Vec2;

It says it wants a Vec2 however if you give it a Vec2 you will get a (Nan,Nan) back, the example shows it wants a number, which does work.

Posts: 1

Participants: 1

Read full topic

Cocos2D iPhone/Objective C Documentation

$
0
0

@chopsalot wrote:

Is there any place remaining on the internet where the Cocos2d 3.4/3.5 for iPhone/Objective-C documentation exists on the internet still ?

I can access the /docs section of the old website using archive.org
http://web.archive.org/web/20180807064606/http://cocos2d-objc.org/docs/
but it seems the link to the documentation has not been archived.

Somewhere out there there was a migration guide between 2.x and 3.x too - if anyone knows where that might exist I would also appreciate it.

I am looking to upgrade my Cocos2d 2.x app to support iPhone X resolution… I can’t seem to see anywhere on the internet that confirms that 3.x supports @3x resolution. If anyone can confirm whether this is the case or not I would be most appreciative!

Posts: 3

Participants: 2

Read full topic

Java based errors in my android project, the androidmanifest.xml is

$
0
0

@Rascake wrote:

An long running error on my android studio project has not been eradicated by several means, I have updated my JDK to now find my android manifest has become almost half unrecognisable, this is my project structure, followed by the xml, and its faulty code, I think it is mainly due to a file error, however due to the several file specification requirements android studio requestions, I do not know which is wrong, the all seem fine. I just ask, which file location would need to be wrong to cause this error to arrouse?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.Plinch.Runtest"
    android:installLocation="auto">

    <uses-permission android:name="android.permission.INTERNET"/>
    
    <uses-feature android:glEsVersion="0x00020000" />
    
    <application
        android:label="@string/app_name"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher">
        
        <!-- Tell Cocos2dxActivity the name of our .so -->
        <meta-data android:name="android.app.lib_name"
                   android:value="Runtest" />

        <activity
            android:name="org.cocos2dx.cpp.AppActivity"
            android:screenOrientation="landscape"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:launchMode="singleTask"
            android:taskAffinity=""  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Posts: 1

Participants: 1

Read full topic

I have a question about the "on tag" of richText.

$
0
0

@jdk1220 wrote:

I want to make hypertext functionality using “on tag”() of richText.
In other words, I want to associate a word in a sentence with a web page.
I tried both methods, but neither worked.
Even a click event.:tired_face:

First

this.richText.string = blah blah <on href=''www.google.com" click="handler">google<\on> blah blah;

Second

    var click_event = new cc.Component.EventHandler();
    click_event.target = this.richText.node;
    click_event.component = "Helloworld";
    click_event.handler = "callback";
    click_event.customEventData = "";

this.richText.string = blah blah <on click="click_event"> google </on> blah blah;

callback(event: cc.Event.EventTouch, customEventData: string) {

    cc.sys.openURL("https://www.google.com");

}

I do not know what to do.:thinking:
Please Help me!
I’m using Cocos Creator version 2.1!

Posts: 1

Participants: 1

Read full topic


I have a question about "on tag" of richText.

Why is cocos creator game slow on IOS?

$
0
0

@MercuryBD wrote:

I’m creating a game in Cocos Creator, and now I created the build for ios. The performance of the game is unpredictable, sometimes it’s good and some time is awful. I minimized draw calls to 30 draw calls max (usually it’s around 15 draw calls), and I optimized everything. I wonder should I switch to cocos2dx… What is the main reason for unpredictable speeds on ios? I don’t want to switch to cocos2dx as I like cocos creator workflow, I’m really productive with it, but the performance drops are my main concern now.

Can anyone tell me what are the speeds on your ios devices and how complex are your games?

Also, can anyone explain to me how build on mobile devices works? Is the game embedded in the browser or something else?

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Child node don't follow its parent in a physics world

$
0
0

@StepOnTheWeb wrote:

First of all, I made the same question on StackOverflow too, I hope this isn’t a problem. I know this question is not new, but all other topic are realy old and I can’t figure out how to fix it.

In my scene I have a node with a RigidBody component. This node have a child with the same RigidBody component. If I move my parent node, the child stay in the original position (if is static, or falls if it is dynamic). Whitout the physics all work as I expected.

There is a solution or a fix ? or is the logic wrong?

Thanks

Posts: 1

Participants: 1

Read full topic

I have a question about “on tag” of richText

$
0
0

@jdk1220 wrote:

I want to make hypertext functionality using “on tag”() of richText.
In other words, I want to associate a word in a sentence with a web page.
I tried both methods, but neither worked.
Even a click event.

First

this.richText.string = blah blah <on href=''www.google.com" click="handler">google<\on> blah blah;

Second

    var click_event = new cc.Component.EventHandler();
    click_event.target = this.richText.node;
    click_event.component = "Helloworld";
    click_event.handler = "callback";
    click_event.customEventData = "";

this.richText.string = blah blah <on click="click_event"> google </on> blah blah;

callback(event: cc.Event.EventTouch, customEventData: string) {

    cc.sys.openURL("https://www.google.com");

}

I do not know what to do!
Please Help me!
I’m using Cocos Creator version 2.1!

Posts: 1

Participants: 1

Read full topic

Handling iPhoneX notch

$
0
0

@Orlan wrote:

Hi everyone,

If I make an iOS build of my app and run ir on an iPhoneX, the top part is not taken care of, with other words: Something from my app is shown “behind” this notch-like thing of the iPhoneX.
Is there any way to fix this, so that nothing important will be hidden behind the notch?

I am using Cocos Creator 1.10.2

Best regards

Posts: 1

Participants: 1

Read full topic

Viewing all 17105 articles
Browse latest View live