Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.olimoli123.fivesecondmania;
- import org.cocos2d.layers.CCScene;
- import org.cocos2d.nodes.CCDirector;
- import org.cocos2d.nodes.CCNode;
- import org.cocos2d.opengl.CCGLSurfaceView;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.View;
- import android.view.Window;
- import android.view.WindowManager;
- import android.widget.EditText;
- import android.widget.LinearLayout;
- import android.widget.TextView;
- public class activity extends Activity {
- protected CCGLSurfaceView _glSurfaceView;
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- _glSurfaceView = new CCGLSurfaceView(this);
- setContentView(_glSurfaceView);
- TextView label = new TextView(this);
- LinearLayout ll = new LinearLayout(this);
- ll.setOrientation(LinearLayout.VERTICAL);
- LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
- label.setId(R.id.label);
- addContentView(ll, layoutParams);
- ll.addView(label, layoutParams);
- }
- @Override
- public void onStart()
- {
- super.onStart();
- CCDirector.sharedDirector().setAnimationInterval(1.0f / 60.0f);
- CCDirector.sharedDirector().attachInView(_glSurfaceView);
- CCScene scene = GameLayer.scene();
- CCDirector.sharedDirector().runWithScene(scene);
- }
- @Override
- public void onPause()
- {
- super.onPause();
- CCDirector.sharedDirector().pause();
- }
- @Override
- public void onResume()
- {
- super.onResume();
- CCDirector.sharedDirector().resume();
- }
- @Override
- public void onStop()
- {
- super.onStop();
- CCDirector.sharedDirector().end();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement