Motorola C450, C550, C370 technical manual

Page 52

source and destination cells overlap, the method shall behave as if the source cells are first copied to a separate array, the source cells are cleared, and the tiles are then copied back to the destination cells. The method parameters are the following: dstCol - column of top-left destination cell; dstRow - row of top-left destination cell; srcCol - column of top-left source cell; srcRow - row of top-left source cell; width - width, in rows, of area of tiles to move; and height - height, in rows, of area of tiles to move.

public void fillCells(int col, int row, int width, int height, int tileIdx) throws IndexOutOfBoundsException, ArrayIndexOutOfBoundsException – Fill each cell in a rectangular area with a given animated or static tile. The method parameters are the following: col - column of top-left cell; row - row of top-left cell; width - width, in rows, of area of cells to fill; height - height, in rows, of area of cells to fill; and tileIdx - index of tile to place in fill region.

public void

draw(javax.microedition.lcdui.Graphics g, int x, int y) throws NullPointerException – Draw the PlayField to a Graphics instance, anchoring the top left corner of the PlayField view window at the position (x, y) on the Graphics instance. The method parameters are the following: g - Graphics instance on which to draw the PlayField; x - the x coordinate of the top left corner of the PlayField; and y - the y coordinate of the top left corner of the PlayField. The PlayField will be drawn as follows:

Draw all the Sprites with depth < 0 in increasing order of depth (depth -2 drawn before or below depth -1);

Draw the tiles for all cells. Empty cells, those with Tile 0, are considered fully transparent, so nothing is drawn for them.

Draw the all the Sprites with depth >= 0 in increasing order of depth (depth 1 drawn before or below depth 2). The location of the Sprites is defined by the Sprite instance and is relative to the top left corner of the PlayField grid.

public int getCellWidth() – Get width of a cell, in pixels.

public int getCellHeight() – Get height of a cell, in pixels.

public int getGridWidth() – Get width of the PlayField grid, in cells.

public int getGridHeight() – Get height of the PlayField grid, in cells.

public boolean anyCollisions() – This method checks whether any of the PlayField's Sprites collide with any of the PlayField's tiles or other Sprites on the PlayField. It will return true if any Sprite on the PlayField collides with a tile or any other Sprite. Like collidesWithSprites(Sprite) and collidesWithAnyTile(Sprite), this method reports collisions only at a boundary level granularity, not pixel level granularity.

public boolean collidesWithSprites(Sprite s) throws

NullPointerException – Check for Sprite collision with any other Sprites on the PlayField. This method is complemented by Sprite.collidesWith(Sprite, boolean); If collidesWithSprites(Sprite) returns true, the developer can find the exact Sprite collision(s) by using Sprite.collidesWith(Sprite, boolean). This is similar to how

Image 52
Contents Technical Manual Table of Contents Lcdui JAD Attributes Introduction PurposeAudience DisclaimerReferences Revision History Definitions, Abbreviations, AcronymsDate Name Reason Acronym DescriptionDocument Overview Introduction J2ME Introduction Java 2 Platform, Micro Edition J2MEMotorola J2ME Platform Resources AvailableDescription Display NetworkingFile & RMS Java VMGuide to Development in J2ME Developing and Packaging J2ME ApplicationsIntroduction to Development Page Installation OTA ProcedureDownloading Applications Program and Data space notes Starting Applications Java Application Installer/De-Installer JaidExiting Applications Launching Web Session for Http Download Error ChecksDownloading MIDlets 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 FormatUDP Sockets TCP SocketsImplementation Notes Network API Lcdui DescriptionLcdui Functional Description Gaming API and SoundClass Hierarchy Using BackgroundMusic BackgroundMusic ClassBackgroundMusic Methods Gaming API containing a sound APIGameScreen Class GameScreen FieldsGameScreen Methods Public int getKeyStatesInformation, disabling key events can improve performance Using GameScreen GameScreenImageUtil Fields ImageUtil ClassImageUtil Methods Using ImageUtil RgbDataPalleteImage Constructor PalleteImage ClassPalleteImage Methods Using PalleteImage Public void setTransparentIndexint index throwsUsing Static and Animated Tiles PlayField ClassDefining View Windows Using SpritesPlayField Constructor 2N+1 2N + PlayField Methods Public void addSpriteSprite s throwsPage Public boolean collidesWithAnyTileSprite s throws Using PlayField PlayFieldUsing SoundEffect SoundEffect ClassSprite Class SoundEffect MethodsSprite Drawing Animation FramesSprite Constructor Sprite Methods Page Public final void drawGraphics g throws FileFormatNotSupportedException Using SpriteSprites Java Gaming Sound API Max Midi Extension SupportFileFormatNotSupportedException Constructors 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 Record Management System Class DescriptionCode Examples 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 SheetsDocumentation Motorola Developer Information ToolsReferences Purchase Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb