Appendix C. Siemens Game API

Game Classes

Programming with the Siemens Game API is discussed in depth in Chapter 23, “Siemens Game API.” The Siemens Game API consists of the following classes:

java.lang.Object
com.siemens.mp.game.Light
com.siemens.mp.game.MelodyComposer
com.siemens.mp.misc.NativeMem
com.siemens.mp.game.ExtendedImage
com.siemens.mp.game.GraphicObject
com.siemens.mp.game.Sprite
com.siemens.mp.game.TiledBackground
com.siemens.mp.game.GraphicObjectManager
com.siemens.mp.game.Melody
com.siemens.mp.game.Sound
com.siemens.mp.game.Vibrator

com.siemens.mp.game.Light

  • Light()

  • static void setLightOff()

  • static void setLightOn()

com.siemens.mp.game.MelodyComposer

  • MelodyComposer()

  • void appendNote(int note, int length)

  • Melody getMelody()

  • int length()

  • static int maxLength()

  • void resetMelody()

  • void setBPM(int bpm)

com.siemens.mp.game.ExtendedImage

  • ExtendedImage(Image image)

  • void blitToScreen(int x, int y)

  • void clear(byte color)

  • Image getImage()

  • int getPixel(int x, int y)

  • void getPixelBytes(byte[] pixels, int x, int y, int width, int height)

  • void setPixel(int x, int y, byte color)

  • void setPixels(byte[] pixels, int x, int y, int width, int height)

com.siemens.mp.game.GraphicObject

  • GraphicObject()

  • boolean getVisible()

  • void setVisible(boolean visible)

com.siemens.mp.game.Sprite

  • Sprite(byte[] pixels, int pixel_offset, int width, int height, byte[] mask, int mask_offset, int numFrames)

  • Sprite(ExtendedImage pixels, ExtendedImage mask, int numFrames)

  • Sprite(Image pixels, Image mask, int numFrames)

  • int getFrame()

  • int getXPosition()

  • int getYPosition()

  • boolean isCollidingWith(Sprite other)

  • boolean isCollidingWithPos(int xpos, int ypos)

  • void setCollisionRectangle(int x, int y, int width, int height)

  • void setFrame(int framenumber)

  • void setPosition(int x, int y)

com.siemens.mp.game.TiledBackground

  • TiledBackground(byte[] tilePixels, byte[] tileMask, byte[] map, int widthInTiles, int heightInTiles)

  • TiledBackground(ExtendedImage tilePixels, ExtendedImage tileMask, byte[] map, int widthInTiles, int heightInTiles)

  • TiledBackground(Image tilePixels, Image tileMask, byte[] map, int widthInTiles, int heightInTiles)

  • void setPositionInMap(int x, int y)

com.siemens.mp.game.GraphicObjectManager

  • GraphicObjectManager()

  • void addObject(GraphicObject gobject)

  • static byte[] createTextureBits(int width, int height, byte[] texture)

  • void deleteObject(GraphicObject gobject)

  • void deleteObject(int position)

  • GraphicObject getObjectAt(int index)

  • int getObjectPosition(GraphicObject gobject)

  • void insertObject(GraphicObject gobject, int position)

  • void paint(ExtendedImage eimage, int x, int y)

  • void paint(Image image, int x, int y)

com.siemens.mp.game.Melody

  • void play()

  • static void stop()

com.siemens.mp.game.Sound

  • Sound()

  • static void playTone(int tone_freq, int tone_time)

com.siemens.mp.game.Vibrator

  • Vibrator()

  • static void startVibrator()

  • static void stopVibrator()

  • static void triggerVibrator(int duration)

Siemens GSM Classes

These classes allow the Java program to access the phone's functions. The classes descend from java.lang.Object:

  • com.siemens.mp.gsm.Call

  • com.siemens.mp.gsm.PhoneBook

  • com.siemens.mp.gsm.SMS

com.siemens.mp.gsm.Call

  • Call()

  • static void start(String number)

com.siemens.mp.gsm.PhoneBook

  • PhoneBook()

  • static String[] GetMDN()

com.siemens.mp.gsm.SMS

  • SMS()

  • static int send(String number, String data)

Input/Output Classes

The Siemens IO classes, descending from java.lang.Object, include the following:

  • com.siemens.mp.io.Connection

  • com.siemens.mp.io.File

  • interface com.siemens.mp.io.ConnectionListener

com.siemens.mp.io.Connection

  • Connection(String connectTo)

  • void send(byte[] data)

  • static void setListener(ConnectionListener listener)

com.siemens.mp.io.File

  • File()

  • int close(int fileDescriptor)

  • static int copy(String source, String dest)

  • static int debugWrite(String fileName, String infoString)

  • static int delete(String fileName)

  • static int exists(String fileName)

  • int length(int fileDescriptor)

  • int open(String fileName)

  • int read(int fileDescriptor, byte[] buf, int offset, int numBytes)

  • static int rename(String source, String dest)

  • int seek(int fileDescriptor, int seekpos)

  • static int spaceAvailable()

  • int write(int fileDescriptor, byte[] buf, int offset, int numBytes)

public interface ConnectionListener

  • void receiveData(byte[] data)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.205.27