2020年5月18日月曜日

AndroidアプリのアイコンはImage Assetで簡単に作れる

Android 8.0以上のAdaptive Iconに対応するにはAndroid StudioのAsset Studioが簡単にできる。
やり方は以下の通り
1.プロジェクトのresフォルダ辺りで右クリック「New」→「Image Asset」を選択する。
2.Foreground Layerでメインの画像を選択
3.Background Layerで背景の設定(画像でも色だけでも可)

2020年5月13日水曜日

cocos2d-x ScrollViewのsetDirection(Direction::NONE)を利かせる

cocos2d-xのスクロールビュー(ScrollView)のスクロール方向を設定するsetDirectionメソッドのスクロールさせない設定(Direction::NONE)が利かない。
以下の修正が必要となる。

CCScrollView.cppのonTouchMovedメソッド内
if (_direction == Direction::VERTICAL) のIF文(763行目あたり)に以下の記述を追加

else if (_direction == Direction::NONE)
{
}


2020年4月18日土曜日

アカウントの調査中という理由でiOSアプリがリジェクトされた

2020年4月9日にApp Store ConnectでiOSアプリをAppleの審査に提出した。

最近は1日か2日で審査が終わるのに、このときは5日程経過しても審査が始まらず新型コロナの影響でApple側の体制が整っていないのかと思っていた。

一週間経過した2020年4月16日にリジェクトされ、以下のようなメッセージが届いた。


Hello,

We are unable to continue this app’s review because your Apple Developer Program account is currently under investigation for not following the App Store Review Guidelines’ Developer Code of Conduct.

Common practices that may lead to an investigation include, but are not limited to:

- Inaccurately describing an app or service
- Misleading app content
- Engaging in inauthentic ratings and reviews manipulation
- Providing misleading customer support responses
- Providing misleading responses in Resolution Center
- Engaging in misleading purchasing or bait-and-switch schemes
- Engaging in other dishonest or fraudulent activity within or outside of the app

During our investigation, we will not review any apps you submit. Once we have completed our investigation, we will notify you via Resolution Center.

We do not require any additional information from you at this time, nor do we have any additional details to share. We appreciate your continued patience during our investigation.

Best regards,

App Store Review


ネットで調べた結果、どうやらアカウントの調査に一ヶ月くらいかかり、その間何もできることがないらしい。

そして、リジェクトされたアプリをApp Store ConnectのマイAppから削除し、全く同じ内容を新しいアプリとして提出したら通ったとの情報があり、それを試すことにした。

すると、今度は提出したその日の夜に直ぐ審査が始まり普通に通った!

というわけで、このようなリジェクトをされた方は面倒ですが一度アプリを削除して新しいアプリで再提出してください。

その際、削除したバンドルIDは同じものが使えないので、新しいものを作成する必要があるので注意してください。

2020年4月17日金曜日

cocos2d-x Androidのナビゲーションバーを表示させる

cocos2d-xでは Ver3.12以降でナビゲーションバー(画面下部にあるホームボタンや戻るボタンが表示されている領域)が非表示になっている。
これを常時表示状態にするには以下の修正が必要となる。
ver4.0で確認しているが、3系でも同様の修正でOKだと思われる。

libcocos2dx→java→org.cocos2dx.lib→Cocos2dxActivity.java

333行目あたりのSYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
335行目あたりのSYSTEM_UI_FLAG_HIDE_NAVIGATION

の部分をコメントアウトする。


========

final Object[] parameters = new Object[]{SYSTEM_UI_FLAG_LAYOUT_STABLE
        //コメントアウト | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
        | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        //コメントアウト | SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
        | SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
        | SYSTEM_UI_FLAG_IMMERSIVE_STICKY};

========

Cocos2d-x マルチタップを無効にする方法(Android)

cocos2d-xはAndroidだけなぜかマルチタップができてしまう。
無効にするには以下の修正が必要となる。
なお、ver4.0で確認しているがこれより古い3系でも同様の対処でOKだと思われる


libcocos2dx→java→org.cocos2dx.lib→Cocos2dxGLSurfaceView.java


228行目あたりのswitch文「case MotionEvent.ACTION_POINTER_DOWN:」の部分を全てコメントアウトにする


switch (pMotionEvent.getAction() & MotionEvent.ACTION_MASK) {
    /*
    case MotionEvent.ACTION_POINTER_DOWN:

        final int indexPointerDown = pMotionEvent.getAction() >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
        if (!mMultipleTouchEnabled && indexPointerDown != 0) {
            break;
        }
        final int idPointerDown = pMotionEvent.getPointerId(indexPointerDown);
        final float xPointerDown = pMotionEvent.getX(indexPointerDown);
        final float yPointerDown = pMotionEvent.getY(indexPointerDown);

        this.queueEvent(new Runnable() {
            @Override
            public void run() {
                Cocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleActionDown(idPointerDown, xPointerDown, yPointerDown);
            }
        });
        break;

     */

    case MotionEvent.ACTION_DOWN: