Showing posts with label AndEngine Examples of Nicolas Gramlich. Show all posts
Showing posts with label AndEngine Examples of Nicolas Gramlich. Show all posts

Friday, September 6, 2013

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - CustomFontExample



Here're some resources for this part:


Copy 5 font files above to the folder assets/font

Create new class named CustomFontExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:
package org.anddev.andengine.examples;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;

Posted By Dev Bananaer7:50 PM

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - CoordinateConversionExample



Create a new class named CoordinateConversionExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:
package org.anddev.andengine.examples;

import static org.anddev.andengine.util.constants.Constants.VERTEX_INDEX_X;
import static org.anddev.andengine.util.constants.Constants.VERTEX_INDEX_Y;

import javax.microedition.khronos.opengles.GL10;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl;

Posted By Dev Bananaer10:06 AM

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - CollisionDetectionExample



Create a new class named CollisionDetectionExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:
package org.anddev.andengine.examples;

import javax.microedition.khronos.opengles.GL10;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl;
import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl.IAnalogOnScreenControlListener;
import org.anddev.andengine.engine.camera.hud.controls.BaseOnScreenControl;

Posted By Dev Bananaer4:39 AM

Thursday, September 5, 2013

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - ChangeableTextExample



Here're some resources for this part:


Create new folder named font in assets folder of the project
Copy font file above to the folder assets/font


Create new class named ChangeableTextExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:
package org.anddev.andengine.examples;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.handler.timer.ITimerCallback;
import org.anddev.andengine.engine.handler.timer.TimerHandler;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;

Posted By Dev Bananaer10:31 PM

Wednesday, September 4, 2013

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - AutoParallaxBackgroundExample



Here're some resources for this part:


Copy 4 pictures above to the folder assets/gfx

Create new class named AutoParallaxBackgroundExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:
package org.anddev.andengine.examples;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;

Posted By Dev Bananaer8:59 PM

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - AugmentedRealityHorizonExample (with camera horizontally)



This example is the same as AugmentedRealityExample using 2 files in org.anddev.andengine.extension.augmentedreality package

Create new class named AugmentedRealityHorizonExample in org.anddev.andengine.examples package. Here is the code of this class:
package org.anddev.andengine.examples;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;

Posted By Dev Bananaer9:13 AM

Tuesday, September 3, 2013

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - AugmentedRealityExample (with camera)


andengineaugmentedrealityextension.jar has some problems when using it to implement this example on emulator, so you can use some files to replace the .jar file

Create the package org.anddev.andengine.extension.augmentedreality and create 2 files like this


Here is the code of BaseAugmentedRealityGameActivity class
package org.anddev.andengine.extension.augmentedreality;

import org.anddev.andengine.opengl.view.ComponentSizeChooser;
import org.anddev.andengine.opengl.view.RenderSurfaceView;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.graphics.PixelFormat;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;

Posted By Dev Bananaer6:49 PM

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - AnimatedSpritesExample


Here're some resources for this part:


Copy 4 pictures above to the folder assets/gfx

Create new class named AnimatedSpritesExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:
package org.anddev.andengine.examples;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;

Posted By Dev Bananaer8:12 AM

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - AnalogOnScreenControlsExample - Multitouch




Here're some resources for this part besides some in previous part (AnalogOnScreenControlExample):


Add andenginemultitouchextension.jar to libs folder of the project

Create new class named AnalogOnScreenControlsExample in the package org.anddev.andengine.examples of the AndEngineDemo project, here is the code of this class:

package org.anddev.andengine.examples;

import javax.microedition.khronos.opengles.GL10;
import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl;
import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl.IAnalogOnScreenControlListener;

Posted By Dev Bananaer1:20 AM

Monday, September 2, 2013

[Tut] How to perform AndEngine Examples of Nicolas Gramlich - AnalogOnScreenControlExample


Here're some resources for this part:

andengine.jar
face_box.png
onscreen_control_base.png
onscreen_control_knob.png

Create a new android application project named AndEngineDemo
Add andengine.jar to libs folder of the project

Create the folder named gfx under the folder assets, and copy 3 pictures above face_box.pngonscreen_control_base.pngonscreen_control_knob.png to this folder

Create the package: org.anddev.andengine.examples in the src folder of the project

Create a new class named BaseExample in the above package, here is the code of this class:

package org.anddev.andengine.examples;

import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.view.Menu;
import android.view.MenuItem;

/**
 * (c) 2010 Nicolas Gramlich 
 * (c) 2011 Zynga Inc.
 * 

Posted By Dev Bananaer10:18 PM

Choose an Android item