📄 mappy.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Sat Aug 02 17:51:14 BST 2003 -->
<TITLE>
Mappy
</TITLE>
<META NAME="keywords" CONTENT="Mappy,Mappy class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="Mappy";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="Mappy.Block.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Mappy.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Mappy</H2>
<PRE>
java.lang.Object
|
+--<B>Mappy</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Mappy</B><DT>extends java.lang.Object</DL>
<P>
Mappy Playback Library for Java Release 6<br> <br> Based on MappyJV Release1 14/07/99 (C)1999 <a href="mailto:rburrows@bigfoot.com">Robin Burrows</a>. <br> <br> This class allows the playback of <a href="http://www.tilemap.co.uk"> Mappy</a> <code>.FMP</code> files. Current limitations are: <ul> <li>Pillars are not supported. <li>Animation Blocks are not fully supported. </ul> After constructing a Mappy class, you must load a Map into it before it can be used. If any of your image blocks are transparent then be sure to set the transparent colour key via <code>setTransparentColour()</code> before you call a <code>loadMap()</code> method. It is also important that you set the screen area that the Map is to be drawn into (via <code>setScreenDimensions() </code>) before any drawing functions are called.<br> <br> As a Map can have up to 8 layers, the Mappy class introduces the concept of a current layer. This current layer is used implicity (i.e. without you specifing)in most of the map operations (e.g. <code>drawForeground()</code>), therefore you must set the current Map layer before calling any Map layer methods. <br> <br> Despite the source for the Mappy Playback being quite large I have kept it in a single source (<code>.java</code>) file to ease portability. For the same reason, <code>Mappy</code> has been moved out of it's default package of <code>com.alienfactory.gaming</code>. Future releases may well begin to spread accross several classes (over 2000 lines, I mean, come on!). <br> <br> See the readme.txt file for more info<br><br>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="Mappy.html#setTransparentColour(int)"><CODE>setTransparentColour(int)</CODE></A>, <A HREF="Mappy.html#loadMap(java.io.File, java.awt.Component)"><CODE>loadMap(File, Component)</CODE></A>, <A HREF="Mappy.html#setScreenDimensions(java.awt.Rectangle)"><CODE>setScreenDimensions(Rectangle)</CODE></A>, <A HREF="Mappy.Block.html"><CODE>Mappy.Block</CODE></A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.Block.html">Mappy.Block</A></B></CODE>
<BR>
Mappy Block v1.10<br> <br> This class represents a <code>Block</code> as used by <code>Mappy</code>.</TD>
</TR>
</TABLE>
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Mappy.html#Mappy()">Mappy</A></B>()</CODE>
<BR>
Constructs a new Mappy Playback Library.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#addX(int)">addX</A></B>(int intIncX)</CODE>
<BR>
Increments the X coordinate of the current Map layer by the given amount (in pixels).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#addY(int)">addY</A></B>(int intIncY)</CODE>
<BR>
Increments the Y coordinate of the current Map layer by the given amount (in pixels).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#animateBlocks()">animateBlocks</A></B>()</CODE>
<BR>
Animates all the animation block structures.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#collisionDetection(int, int)">collisionDetection</A></B>(int intX, int intY)</CODE>
<BR>
Performs a collision detection test at the given pixel coordinates using the <code>Block</code>'s collision flags.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#drawBackground(java.awt.Graphics, boolean)">drawBackground</A></B>(java.awt.Graphics gfx, boolean blnTransparency)</CODE>
<BR>
Draws the Blocks' background of the current Map layer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#drawForeground(java.awt.Graphics, int)">drawForeground</A></B>(java.awt.Graphics gfx, int intBlockLayer)</CODE>
<BR>
Draws the Blocks' foreground of the current Map layer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="Mappy.Block.html">Mappy.Block</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getBlock(int, int)">getBlock</A></B>(int intBlockX, int intBlockY)</CODE>
<BR>
Returns the <code>Block</code> used at the given <code>Block</code> coordinates, in the current Map layer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getBlockHeight()">getBlockHeight</A></B>()</CODE>
<BR>
Returns the height of a Block, in pixels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getBlockWidth()">getBlockWidth</A></B>()</CODE>
<BR>
Returns the width of a Block, in pixels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getBlockX()">getBlockX</A></B>()</CODE>
<BR>
Returns the X coordinate of the current Map layer, in Blocks.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getBlockY()">getBlockY</A></B>()</CODE>
<BR>
Returns the Y coordinate of the current Map layer, in Blocks.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getCurrentMapLayer()">getCurrentMapLayer</A></B>()</CODE>
<BR>
Returns the current Map layer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getMapDescription()">getMapDescription</A></B>()</CODE>
<BR>
Returns a description of the Map.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getMapHeight()">getMapHeight</A></B>()</CODE>
<BR>
Returns the total height of the Map, in pixels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getMapHeightBlocks()">getMapHeightBlocks</A></B>()</CODE>
<BR>
Returns the total height of the Map, in blocks.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getMapWidth()">getMapWidth</A></B>()</CODE>
<BR>
Returns the total width of the Map, in pixels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getMapWidthBlocks()">getMapWidthBlocks</A></B>()</CODE>
<BR>
Returns the total width of the Map, in blocks.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.awt.Rectangle</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getScreenDimensions()">getScreenDimensions</A></B>()</CODE>
<BR>
Returns the screen dimensions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getTransparentColour()">getTransparentColour</A></B>()</CODE>
<BR>
Returns the transparent colour used for Block Images in <code>RGB</code> format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getX()">getX</A></B>()</CODE>
<BR>
Returns the X coordinate of the current Map layer, in pixels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#getY()">getY</A></B>()</CODE>
<BR>
Returns the Y coordinate of the current Map layer, in pixels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#loadMap(java.io.File, java.awt.Component)">loadMap</A></B>(java.io.File file, java.awt.Component component)</CODE>
<BR>
Loads a <code>.FMP</code> Map from a given <code>File</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#loadMap(java.io.InputStream, java.awt.Component)">loadMap</A></B>(java.io.InputStream stream, java.awt.Component component)</CODE>
<BR>
Loads a <code>.FMP</code> Map from a given <code>InputStream</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#loadMap(java.lang.String, java.awt.Component)">loadMap</A></B>(java.lang.String strFileName, java.awt.Component component)</CODE>
<BR>
Loads a <code>.FMP</code> Map from a given filename.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Mappy.html#loadMAR(java.lang.String, int)">loadMAR</A></B>(java.lang.String strFileName, int marlyr)</CODE>
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -