[Cocos2d-x entry practice] WeChat aircraft war 15: cross-platform transplantation and advertising Implantation

Source: Internet
Author: User


For more information about how to create a configuration, see the preceding section.

If (! CCDirector: sharedDirector ()-> getOpenGLView () {CCEGLView * view = & CCEGLView: Export dopenglview (); view-> setFrameSize (w, h ); // set the design resolution screen size, if you want to use Design Resoulution scaled to current screen, please uncomment next line. view-> setDesignResolutionSize (480,800); // Add this statement to adapt to the screen AppDelegate * pAppDelegate = new AppDelegate (); CCApplication: sharedApplication (). run ();}

LOCAL_SRC_FILES := helloworld/main.cpp \                   ../../Classes/AppDelegate.cpp \   ../../Classes/BulletLayer.cpp \   ../../Classes/ControlLayer.cpp \   ../../Classes/Enemy1Layer.cpp \   ../../Classes/Enemy2Layer.cpp \   ../../Classes/Enemy3Layer.cpp \   ../../Classes/GameLayer.cpp \   ../../Classes/GameScene.cpp \   ../../Classes/PlaneLayer.cpp \   ../../Classes/WelcomeLayer.cpp \   ../../Classes/WelcomeScene.cpp \   ../../Classes/Enemy1Sprite.cpp \   ../../Classes/Enemy2Sprite.cpp \   ../../Classes/Enemy3Sprite.cpp \   ../../Classes/UFOLayer.cpp \   ../../Classes/GameOverLayer.cpp \   ../../Classes/GameOverScene.cpp \   ../../Classes/MutiBulletsLayer.cpp 

public class JackyAirplane extends Cocos2dxActivity
public class Cocos2dxActivity extends Activity

Runnable runnable = new Runnable () {@ Overridepublic void run () {// TODO Auto-generated method stubIntent intent = new Intent (LoadActivity. this, JackyAirplane. class); LoadActivity. this. startActivity (intent); // switch ActivityLoadActivity. this. finish ();}};

Public class JackyAirplane extends Cocos2dxActivity {... public static AdView adView; // 3rd-party Advertisement}

public static void showAD() {   new Thread(new Runnable(){   @Override  public void run() {  adView.setVisibility( adView.VISIBLE );  }   }).start();}

# Include <jni/JniHelper. h> JniMethodInfo minfo; jobject jobj; bool B = JniHelper: getStaticMethodInfo (minfo, "com/jacky/jackyAirplane/JackyAirplane", // class path "showAD ", // static method name "() V"); // parameters in brackets, followed by the returned value if (B) jobj = minfo. env-> CallStaticObjectMethod (minfo. classID, minfo. methodID); else; // print error...


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.