Alien-Factory :: JavaMappy Framework 2.2.10 API

This document is the API specification for the Alien-Factory JavaMappy v2.

See:
          Description

Packages
com.alienfactory.javamappy Contains the core API and objects that mimic the logical structure of a .FMP Map.
com.alienfactory.javamappy.loader These classes are only concerned with loading FMP Chunks.
com.alienfactory.javamappy.util Generic utility classes.
com.alienfactory.javamappy.viewer These classes, when given the relevant Mappy data objects, concern themselves with displaying Maps and Layers.
com.alienfactory.javamappy.viewer.render These classes purely handle the rendering of blocks, allowing you to swap in and out new renderers dependent on your platform; be it an Applet, JDK 1.4, or J2ME.

 

This document is the API specification for the Alien-Factory JavaMappy v2.

JavaMappy has been designed to run on all Java platforms. It is largely common code that has been written to the lowest common denominator, J2ME. To compensate JavaMappy makes use of platform specific pluggable renderers that render your Map to the screen.

Below is the simplist bit of code I can think of to get JavaMappy up and running and drawing a (non-animated) Map.


        import java.awt.Graphics;
        import java.io.FileInputStream;
        import javax.swing.JFrame;
        import com.alienfactory.javamappy.Map;
        import com.alienfactory.javamappy.loader.MapLoader;
        import com.alienfactory.javamappy.viewer.MapViewer;
        import com.alienfactory.javamappy.viewer.render.*;
        
        public class SimpleExample extends JFrame {
                private static MapViewer mapViewer;
        
                public void paint(Graphics gfx) {
                        mapViewer.draw(gfx, false);
                }
        
                public static void main(String[] args) throws Exception {
                        FileInputStream mapStream = new FileInputStream("alienEpidemic.fmp");
                        Map map         = MapLoader.loadMap(mapStream);
                        Renderer r      = new JDK12Renderer(map);               
                        mapViewer       = new MapViewer(map, r, 320, 256);
                        mapStream.close();              
                        
                        SimpleExample window = new SimpleExample();
                        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        window.setSize(320, 256);
                        window.setVisible(true);
                }
        }



Copyright © 2001-2009 Alien-Factory Ltd. All Rights Reserved.