Learning notes for the Andengine introductory tutorial

Source: Internet
Author: User
Tags anonymous

Example of the main program. Launcher.examplelauncher inherits from the Expandablelistactivity list,
The main definition here is another enumeration of public enum Examplegroup and enum Example, which is usually worth learning because it is less used like them.

The code is as follows Copy Code

Enum Example {

// ===========================================================

Elements

// ===========================================================

Analogonscreencontrol (Analogonscreencontrolexample.class, R.string.example_analogonscreencontrol),

Analogonscreencontrols (Analogonscreencontrolsexample.class, R.string.example_analogonscreencontrols),

Animatedsprites (Animatedspritesexample.class, R.string.example_animatedsprites),

Augmentedreality (Augmentedrealityexample.class, r.string.example_augmentedreality),

Augmentedrealityhorizon (Augmentedrealityhorizonexample.class, R.string.example_augmentedrealityhorizon),

Autoparallaxbackground (Autoparallaxbackgroundexample.class, R.string.example_autoparallaxbackground),

Boundcamera (Boundcameraexample.class, R.string.example_boundcamera),

Changeabletext (Changeabletextexample.class, R.string.example_changeabletext),

Collisiondetection (Collisiondetectionexample.class, r.string.example_collisiondetection),

Colorkeytexturesourcedecorator (Colorkeytexturesourcedecoratorexample.class, R.string.example_ Colorkeytexturesourcedecorator),

Coordinateconversion (Coordinateconversionexample.class, r.string.example_coordinateconversion),

Customfont (Customfontexample.class, R.string.example_customfont),

Digitalonscreencontrol (Digitalonscreencontrolexample.class, R.string.example_digitalonscreencontrol),

Easefunction (Easefunctionexample.class, r.string.example_easefunction),

Imageformats (Imageformatsexample.class, R.string.example_imageformats),

Levelloader (Levelloaderexample.class, R.string.example_levelloader),

Line (Lineexample.class, R.string.example_line),

Loadtexture (Loadtextureexample.class, R.string.example_loadtexture),

MENU (Menuexample.class, R.string.example_menu),

Modplayer (Modplayerexample.class, R.string.example_modplayer),

Movingball (Movingballexample.class, R.string.example_movingball),

Multiplayer (Multiplayerexample.class, R.string.example_multiplayer),

Multitouch (Multitouchexample.class, R.string.example_multitouch),

MUSIC (Musicexample.class, R.string.example_music),

PAUSE (Pauseexample.class, R.string.example_pause),

Pathmodifier (Pathmodifierexample.class, R.string.example_pathmodifier),

Particlesystemnexus (Particlesystemnexusexample.class, R.string.example_particlesystemnexus),

Particlesystemcool (Particlesystemcoolexample.class, R.string.example_particlesystemcool),

Particlesystemsimple (Particlesystemsimpleexample.class, R.string.example_particlesystemsimple),

Physicsconllisionfiltering (Physicscollisionfilteringexample.class, r.string.example_physicscollisionfiltering),

Physics (Physicsexample.class, R.string.example_physics),

Physicsfixedstep (Physicsfixedstepexample.class, R.string.example_physicsfixedstep),

Physicsjump (Physicsjumpexample.class, R.string.example_physicsjump),

Physicsrevolutejoint (Physicsrevolutejointexample.class, R.string.example_physicsrevolutejoint),

Physicsremove (Physicsremoveexample.class, R.string.example_physicsremove),

Pinchzoom (Pinchzoomexample.class, R.string.example_pinchzoom),

RECTANGLE (Rectangleexample.class, R.string.example_rectangle),

Repeatingspritebackground (Repeatingspritebackgroundexample.class, R.string.example_repeatingspritebackground),

Rotation3D (Rotation3dexample.class, r.string.example_rotation3d),

Shapemodifier (Shapemodifierexample.class, R.string.example_shapemodifier),

Shapemodifierirregular (Shapemodifierirregularexample.class, R.string.example_shapemodifierirregular),

SOUND (Soundexample.class, R.string.example_sound),

Splitscreen (Splitscreenexample.class, R.string.example_splitscreen),

SPRITE (Spriteexample.class, R.string.example_sprite),

Spriteremove (Spriteremoveexample.class, R.string.example_spriteremove),

Strokefont (Strokefontexample.class, R.string.example_strokefont),

submenu (Submenuexample.class, R.string.example_submenu),

TEXT (Textexample.class, R.string.example_text),

Textmenu (Textmenuexample.class, R.string.example_textmenu),

Textureoptions (Textureoptionsexample.class, r.string.example_textureoptions),

Tmxtiledmap (Tmxtiledmapexample.class, R.string.example_tmxtiledmap),

Tickertext (Tickertextexample.class, R.string.example_tickertext),

Touchdrag (Touchdragexample.class, R.string.example_touchdrag),

Unloadresources (Unloadresourcesexample.class, r.string.example_unloadresources),

Updatetexture (Updatetextureexample.class, R.string.example_updatetexture),

Xmllayout (Xmllayoutexample.class, R.string.example_xmllayout),

ZOOM (Zoomexample.class, R.string.example_zoom),

Benchmark_animation (Animationbenchmark.class, r.string.example_benchmark_animation),

Benchmark_particlesystem (Particlesystembenchmark.class, R.string.example_benchmark_particlesystem),

Benchmark_physics (Physicsbenchmark.class, R.string.example_benchmark_physics),

Benchmark_shapemodifier (Shapemodifierbenchmark.class, R.string.example_benchmark_shapemodifier),

Benchmark_sprite (Spritebenchmark.class, R.string.example_benchmark_sprite),

Benchmark_tickertext (Tickertextbenchmark.class, R.string.example_benchmark_tickertext),

App_cityradar (Cityradaractivity.class, R.string.example_app_cityradar),

Game_snake (Snakegameactivity.class, R.string.example_game_snake),

Game_racer (Racergameactivity.class, r.string.example_game_racer);

// ===========================================================

Constants

// ===========================================================

// ===========================================================

Fields

// ===========================================================

Public final class<? Extends basegameactivity> CLASS;

public final int nameresid;

// ===========================================================

Constructors

// ===========================================================

Private Example (final class<? extends basegameactivity> pexampleclass, final int pnameresid) {

This. CLASS = Pexampleclass;

This. Nameresid = Pnameresid;

}

// ===========================================================

Getter & Setter

// ===========================================================

// ===========================================================

Methods For/from superclass/interfaces

// ===========================================================

// ===========================================================

Methods

// ===========================================================

// ===========================================================

Inner and Anonymous Classes

// ===========================================================

}

The public final class< above;? Extends basegameactivity> CLASS; represents any type inherited from Basegameactivity, which belongs to the generic type.
Because Andengine's example programs are inherited from Basegameactivity.

The code is as follows Copy Code

public enum Examplegroup {

// ===========================================================

Elements

// ===========================================================

Simple (R.string.examplegroup_simple,

Example.line, Example.rectangle, Example.sprite, Example.spriteremove),

Modifier_and_animation (R.string.examplegroup_modifier_and_animation,

Example.movingball, Example.shapemodifier, Example.shapemodifierirregular, Example.pathmodifier, Example.animatedsprites, Example.easefunction, Example.rotation3d),

Touch (R.string.examplegroup_touch,

Example.touchdrag, Example.multitouch, Example.analogonscreencontrol, Example.digitalonscreencontrol, Example.analogonscreencontrols, Example.coordinateconversion, Example.pinchzoom),

Particlesystem (R.string.examplegroup_particlesystems,

Example.particlesystemsimple, Example.particlesystemcool, Example.particlesystemnexus),

Multiplayer (R.string.examplegroup_multiplayer,

Example.multiplayer),

Physics (R.string.examplegroup_physics,

Example.collisiondetection, Example.physics, Example.physicsfixedstep, example.physicsconllisionfiltering, Example.physicsjump, Example.physicsrevolutejoint, Example.physicsremove),

TEXT (R.string.examplegroup_text,

Example.text, Example.tickertext, Example.changeabletext, Example.customfont, Example.strokefont),

AUDIO (R.string.examplegroup_audio,

Example.sound, Example.music, Example.modplayer),

ADVANCED (r.string.examplegroup_advanced,

Example.splitscreen, Example.boundcamera),//Example.augmentedreality, Example.augmentedrealityhorizon),

BACKGROUND (R.string.examplegroup_background,

Example.repeatingspritebackground, Example.autoparallaxbackground, Example.tmxtiledmap),

Other (R.string.examplegroup_other,

Example.pause, Example.menu, Example.submenu, Example.textmenu, Example.zoom, Example.imageformats, Example.textureoptions, Example.colorkeytexturesourcedecorator, Example.loadtexture, Example.UPDATETEXTURE, Example.xmllayout, Example.levelloader),

APP (R.string.examplegroup_app,

Example.app_cityradar),

GAME (R.string.examplegroup_game,

Example.game_snake, Example.game_racer),

BENCHMARK (R.string.examplegroup_benchmark,

Example.benchmark_sprite, Example.benchmark_shapemodifier, Example.benchmark_animation, Example.BENCHMARK_ Tickertext, Example.benchmark_particlesystem, example.benchmark_physics);

// ===========================================================

Constants

// ===========================================================

// ===========================================================

Fields

// ===========================================================

Public final example[] examples;

public final int nameresid;

// ===========================================================

Constructors

// ===========================================================

Private Examplegroup (final int pnameresid, final Example ... pexamples) {

This. Nameresid = Pnameresid;

This. examples = Pexamples;

}

// ===========================================================

Getter & Setter

// ===========================================================

// ===========================================================

Methods For/from superclass/interfaces

// ===========================================================

// ===========================================================

Methods

// ===========================================================

// ===========================================================

Inner and Anonymous Classes

// ===========================================================

}

The main program is relatively simple, no longer introduced.

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.