Motorola C450, C550, C370 technical manual

Page 58

public void setDepth(int d) – Set Sprite's depth order. The depth order is relative to other Sprites when multiple Sprites are contained in a container object, i.e. a PlayField. When Sprites are drawn explicitly instead of implicitly through the use of a container object, the management of drawing order is the responsibility of the developer. Integer.MIN_VALUE is the lowest depth, Integer.MAX_VALUE is the highest depth. So items with depth Integer.MIN_VALUE would be drawn first, or at the bottom, and items with depth Integer.MAX_VALUE would be drawn last or on top.

public void move(int dx, int dy) – Move Sprite. The method parameters are dx - pixels to move Sprite along horizontal axis, and dy - pixels to move Sprite along vertical axis.

public int getX() – Get Sprite's x position.

public int getY() – Get Sprite's y position.

public int getDepth() – Get Sprite's depth order.

public int getHeight() – Get Sprite's height order.

public int getWidth() – Get Sprite's width in pixels.

public boolean collidesWith(Sprite s,

boolean pixelLevel) throws NullPointerException – Check for collision between two Sprites. If pixelLevel is false, check for overlap in the rectangular areas of the two Sprites, using positions (x, y) and extents (width, height). The two Sprites are treated as if they are in the same coordinate system. For example, if the two Sprites are on different PlayFields that are drawn at different locations, this method still behaves as if they are on the same PlayField. If pixelLevel is true, check for overlap in opaque pixels of the two Sprites. Overlapping in transparent regions of either Sprite will not be considered a collision.

public void setFrame(int frame) – Set Sprite's animation frame. Sets which frame from the frame sequence to draw when draw(Graphics) is called. All Sprites have a default frame sequence as described in the constructor.

public int getFrame() – Get Sprite's current animation frame. All Sprites have a default frame sequence as described in the constructor.

public int getNumRawFrames() – Get the number of raw frames in the original frame set for this Sprite.

public void nextFrame() – Set current animation frame to the next frame. Advance to next frame in the frame sequence. All Sprites have a default frame sequence as described in the constructor. Frame list is considered to be circular, i.e. if nextFrame() is called when the last frame is the current frame, this will advance to the first frame.

public void prevFrame() – Set current animation frame to the previous frame. Advance to previous frame in the frame sequence. All Sprites have a default frame sequence as described in the constructor. Frame list is considered to be circular, i.e. if prevFrame() is called when the first frame is the current frame, this will advance to the last frame.

Image 58
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 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 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 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 PlayFieldSprite Class Using SoundEffectSoundEffect Class SoundEffect MethodsSprite Drawing Animation FramesSprite Constructor Sprite Methods Page Public final void drawGraphics g throws FileFormatNotSupportedException Using SpriteSprites 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 SheetsDocumentation Motorola Developer Information ToolsReferences Purchase Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb