레이블이 AppActivity.java인 게시물을 표시합니다. 모든 게시물 표시
레이블이 AppActivity.java인 게시물을 표시합니다. 모든 게시물 표시

2015년 8월 20일 목요일

cocos2d-x 3.6 multi resolution & hide softkey

Appdelete.cpp
bool AppDelegate::applicationDidFinishLaunching() 
{
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLViewImpl::create("gajah");
        director->setOpenGLView(glview);
    }
    auto fs = glview->getFrameSize();
 glview->setDesignResolutionSize(fs.width, fs.height, kResolutionShowAll);

 FileUtils::getInstance()->addSearchPath("ccs");//add path for datas

    // turn on display FPS
    //director->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);

    register_all_packages();

    // create a scene. it's an autorelease object
    auto scene = HelloWorld::createScene();

    // run
    director->runWithScene(scene);

    return true;
}

proj.android/src/org/cocos2dx/cpp/AppActivity.java

package org.cocos2dx.cpp;

import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;

import android.os.Build;
import android.os.Bundle;

public class AppActivity extends Cocos2dxActivity {
 private static Cocos2dxGLSurfaceView glSurfaceView;

 @Override
 protected void onCreate(final Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

 }
 
 public Cocos2dxGLSurfaceView onCreateView() {
  glSurfaceView = new Cocos2dxGLSurfaceView(this);

  // create stencil buffer
  glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
  this.uiHide();

  

  return glSurfaceView;
 }

 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
  super.onWindowFocusChanged(hasFocus);
  if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
  {
   uiHide();
  }
 }
 
 private void uiHide() {
  if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
  {
   glSurfaceView.setSystemUiVisibility(
     Cocos2dxGLSurfaceView.SYSTEM_UI_FLAG_LAYOUT_STABLE
     | Cocos2dxGLSurfaceView.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
     | Cocos2dxGLSurfaceView.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
     | Cocos2dxGLSurfaceView.SYSTEM_UI_FLAG_HIDE_NAVIGATION
     | Cocos2dxGLSurfaceView.SYSTEM_UI_FLAG_FULLSCREEN
     | Cocos2dxGLSurfaceView.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
  }
 }
}

in this code,

added on AppActivity.java

onCreateView() function added

2014년 7월 15일 화요일

cocos2d-x 3.1 with cocostudio ISSUE


this is my Question

http://discuss.cocos2d-x.org/t/cocostudio-export-data-use-on-cocos2dx-3-1/15534


I received answer

http://discuss.cocos2d-x.org/t/android-stencil-buffer-not-enabled/11089

on page,

So you can refer to cocos2d-x/samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/TestCpp.java

and i go to

C:\Users\pineoc\Desktop\cocos2d-x-3.1.1\tests\cpp-tests\proj.android\src\org\cocos2dx\cpp_tests


on code(AppActivity.java),

ckage org.cocos2dx.cpp_tests;

import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;

public class AppActivity extends Cocos2dxActivity {
   
    public Cocos2dxGLSurfaceView onCreateView() {
        Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
        // TestCpp should create stencil buffer
        glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
       
        return glSurfaceView;
    }
}

this code copy to my project folder android
C:\Users\pineoc\cocos2d-x-3.1.1\\proj.android\src\org\cocos2dx\cpp\AppActivity.java

add code

import org.cocos2dx.lib.Cocos2dxGLSurfaceView;

public Cocos2dxGLSurfaceView onCreateView() {
        Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
        // TestCpp should create stencil buffer
        glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
       
        return glSurfaceView;
    }

and you will see that all okay
success!

good for coding!

JIRA Plugin - ScriptRunner 소개 #2

관련 글 소개 #1:  https://pineoc.blogspot.com/2019/03/scriptrunner-1.html ScriptRunner 소개 #2 지난 글에서는 Behaviours를 보았고 다음 내용인 콘솔, 리스너 등을 ...