Motorola C370, C550, C450 technical manual 2N+1 2N +

Page 50

multiple of the tile width. The height of the source image must be an integer multiple of the tile height.

The tiles in the source image will have indices as follows:

The static tiles are indexed like words are read on a page; left-to-right, then top-to- bottom. The top-left tile is assigned index 1. If there is a tile to its right, this tile is assigned index 2, and so on, across the first row of tiles. If there is a second row of tiles, the index of the left-most tile in this row is one greater than the right-most tile in the preceding row. The table below is a diagrammatic depiction:

1

2

. . .

N

 

 

 

 

N+1

N + 2

. . .

2N

 

 

 

 

2N+1

2N + 2

. . .

 

 

 

 

 

. . .

. . .

. . .

. . .

 

 

 

 

[(M – 1) *

[(M-1) * N )] + 2

. . .

(M * N )

N]+1

 

 

 

 

 

 

 

So the total number of tiles is M * N, where:

N = (image width) / (tile width);

M = (image height) / (tile height).

The indices for the static tile set will be non-negative (>=0) and the indices for animated tiles will be negative (<0). The index sets do not overlap and therefore indices for static and animated tiles can be used interchangeably in the methods that set or move the contents of the PlayField cells. The static Tile set shall behave as if the image used in creation were cached. If a mutable image is used to create the tiles, the tiles' appearances should not reflect changes to the mutable source image. The appearance of individual static tiles can be changed with setStaticTileImage(). The entire static tile set can be changed using setStaticTileSet(). These methods should be used sparingly since they are both memory and time consuming.

PlayField (int columns, int rows, int cellWidth,

int cellHeight) throws IllegalArgumentException - Creates a new PlayField without a tile set. The parameter are the following:

columns - width of the PlayField in number of cells;

rows - height of the PlayField in number of cells;

cellWidth - Pixel width of each cell;

cellHeight - Pixel height of each cell.

It creates a new PlayField, rows cells high and columns cells wide. A PlayField created with this constructor will not have any tiles (animated or static) associated with it. The primary use of a PlayField without tiles is expected to be as a container for managing sprites. The on-screen pixel dimensions of cells is defined by the parameters cellWidth and cellHeight. The cells in the

Image 50
Contents Technical Manual Table of Contents Lcdui JAD Attributes Audience IntroductionPurpose DisclaimerReferences Date Name Reason Revision HistoryDefinitions, Abbreviations, Acronyms Acronym DescriptionDocument Overview Introduction J2ME Introduction Java 2 Platform, Micro Edition J2MEMotorola J2ME Platform Resources AvailableFile & RMS Description DisplayNetworking Java VMIntroduction to Development Developing and Packaging J2ME ApplicationsGuide to Development in J2ME Page Downloading Applications OTA ProcedureInstallation Program and Data space notes Exiting Applications Java Application Installer/De-Installer JaidStarting Applications Downloading MIDlets Error ChecksLaunching Web Session for Http Download XML Screen Renderings BombMan is back, now on your Taichi series of handsets Taichi handset New Games Application Management MIDlet LifecycleMIDlet Suite Installation MIDlet Suite De-installation MIDlet Suite Updating DestroyAppMethod Caller PurposeStartApp or the pauseApp Using startApp Java System MIDlet Control of MIDlet State TransitionsPage Network API Network ConnectionsClass Descriptions IOException when it detects a time-out condition URL FormatImplementation Notes TCP SocketsUDP Sockets Network API Lcdui DescriptionLcdui Class Hierarchy Gaming API and SoundFunctional Description BackgroundMusic Methods Using BackgroundMusicBackgroundMusic Class Gaming API containing a sound APIGameScreen Class GameScreen FieldsGameScreen Methods Public int getKeyStatesInformation, disabling key events can improve performance Using GameScreen GameScreenImageUtil Methods ImageUtil ClassImageUtil Fields Using ImageUtil RgbDataPalleteImage Methods PalleteImage ClassPalleteImage Constructor Using PalleteImage Public void setTransparentIndexint index throwsUsing Static and Animated Tiles PlayField ClassPlayField Constructor Using SpritesDefining View Windows 2N+1 2N + PlayField Methods Public void addSpriteSprite s throwsPage Public boolean collidesWithAnyTileSprite s throws Using PlayField PlayFieldSprite Class Using SoundEffectSoundEffect Class SoundEffect MethodsSprite Constructor Animation FramesSprite Drawing Sprite Methods Page Public final void drawGraphics g throws Sprites Using SpriteFileFormatNotSupportedException FileFormatNotSupportedException Constructors Java Gaming Sound APIMax Midi Extension Support Java Gaming Sound APIVibe and Backlight Vibe and Backlight APIOverview Creating a MessageSending a Message PermissionsJAD Attributes JAD AttributesMandatory attributes for manifest files MIDlet-Name Code Examples Record Management SystemClass Description RecordStoreTips CaveatsPhonebook Access Phonebook Access APIPhonebook Access API Permissions Sample of code to create object of PhoneBookRecord classSimmemory Sample of code for calling of ‘getMaxEmailLength ’ method Sample of code for calling of ‘isPrimaryint speedNo’ method Sample of code for calling of ‘getNumberCategories’ method Sample of code for calling of ‘setCategoryView’ method Sample of code for calling of ‘getUsedRecords’ method Int index = ReceivedRecord.getRecord1 ITAP Intelligent Keypad Text Entry APIAppendix a Key Mapping Key Mapping for the C370, C450, and C550Center Select END Appendix B Memory Management Calculation Available MemoryOnline FAQ Appendix CAppendix D Spec Sheets C370, C450, and C550 Spec SheetsReferences Purchase Motorola Developer Information ToolsDocumentation Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb