📄 mappy.html
字号:
<PRE>
public void <B>setCurrentMapLayer</B>(int intMapLayer)</PRE>
<DL>
<DD>Sets the current Map layer. This layer is used implicitly in all the map specific functions (e.g. <code>drawBackground()</code>), so it is important that this is set first. <br> <br> A valid Map always has layer "0" and may have up to 7 more. If you try to set the Map layer to a layer that doesn't exist then the current Map layer remains unchanged. <br> <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>intMapLayer</CODE> - the new current Map layer.<DT><B>See Also:</B><DD><A HREF="Mappy.html#getCurrentMapLayer()"><CODE>getCurrentMapLayer()</CODE></A>, <A HREF="Mappy.html#setX(int)"><CODE>setX(int)</CODE></A>, <A HREF="Mappy.html#addX(int)"><CODE>addX(int)</CODE></A>, <A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A>, <A HREF="Mappy.html#setY(int)"><CODE>setY(int)</CODE></A>, <A HREF="Mappy.html#addY(int)"><CODE>addY(int)</CODE></A>, <A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A>, <A HREF="Mappy.html#getBlockX()"><CODE>getBlockX()</CODE></A>, <A HREF="Mappy.html#getBlockY()"><CODE>getBlockY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCurrentMapLayer()"><!-- --></A><H3>
getCurrentMapLayer</H3>
<PRE>
public int <B>getCurrentMapLayer</B>()</PRE>
<DL>
<DD>Returns the current Map layer. This layer is used implicitly in all the map specific functions (e.g. <code>drawBackground()</code>), so it is important that this is set first. <br> <br> A valid Map always has layer "0" and may have up to 7 more. <br> <br>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current Map layer.<DT><B>See Also:</B><DD><A HREF="Mappy.html#setCurrentMapLayer(int)"><CODE>setCurrentMapLayer(int)</CODE></A>, <A HREF="Mappy.html#setX(int)"><CODE>setX(int)</CODE></A>, <A HREF="Mappy.html#addX(int)"><CODE>addX(int)</CODE></A>, <A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A>, <A HREF="Mappy.html#setY(int)"><CODE>setY(int)</CODE></A>, <A HREF="Mappy.html#addY(int)"><CODE>addY(int)</CODE></A>, <A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A>, <A HREF="Mappy.html#getBlockX()"><CODE>getBlockX()</CODE></A>, <A HREF="Mappy.html#getBlockY()"><CODE>getBlockY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setX(int)"><!-- --></A><H3>
setX</H3>
<PRE>
public void <B>setX</B>(int intNewX)</PRE>
<DL>
<DD>Sets the X coordinate of the current Map layer, in pixels. <br> <br> The new X coordinate is clipped, so that it is always greater than zero and less than the Map's pixel width minus the current screenwidth. This ensures that whatever the X coordinate is set to, a complete portion of the Map can be displayed. <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>intNewX</CODE> - the new X coordinate of the current Map layer in pixels.<DT><B>See Also:</B><DD><A HREF="Mappy.html#addX(int)"><CODE>addX(int)</CODE></A>, <A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="addX(int)"><!-- --></A><H3>
addX</H3>
<PRE>
public void <B>addX</B>(int intIncX)</PRE>
<DL>
<DD>Increments the X coordinate of the current Map layer by the given amount (in pixels). <br> <br> This helper method effectivly just calls <code>setX()</code> so the same clipping rules apply. <br> <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>intIncX</CODE> - what to increment the X coordinate of the current Map layer by, in pixels (may be negative).<DT><B>See Also:</B><DD><A HREF="Mappy.html#setX(int)"><CODE>setX(int)</CODE></A>, <A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getX()"><!-- --></A><H3>
getX</H3>
<PRE>
public int <B>getX</B>()</PRE>
<DL>
<DD>Returns the X coordinate of the current Map layer, in pixels. <br> <br> I'm thinking of renaming this method to <code>getPixelX()</code> to be more in line with <code>getBlockX()</code>. <br>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the X coordinate of the current Map layer, in pixels.<DT><B>See Also:</B><DD><A HREF="Mappy.html#addX(int)"><CODE>addX(int)</CODE></A>, <A HREF="Mappy.html#setX(int)"><CODE>setX(int)</CODE></A>, <A HREF="Mappy.html#getBlockX()"><CODE>getBlockX()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setY(int)"><!-- --></A><H3>
setY</H3>
<PRE>
public void <B>setY</B>(int intNewY)</PRE>
<DL>
<DD>Sets the Y coordinate of the current Map layer, in pixels. <br> <br> The new Y coordinate is clipped, so that it is always greater than zero and less than the Map's pixel height minus the current screenheight. This ensures that whatever the Y coordinate is set to, a complete portion of the Map can be displayed. <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>intNewY</CODE> - the new Y coordinate of the current Map layer in pixels.<DT><B>See Also:</B><DD><A HREF="Mappy.html#addY(int)"><CODE>addY(int)</CODE></A>, <A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="addY(int)"><!-- --></A><H3>
addY</H3>
<PRE>
public void <B>addY</B>(int intIncY)</PRE>
<DL>
<DD>Increments the Y coordinate of the current Map layer by the given amount (in pixels). <br> <br> This helper method effectivly just calls <code>setY()</code> so the same clipping rules apply. <br> <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>intIncY</CODE> - what to increment the Y coordinate of the current Map layer by, in pixels (may be negative).<DT><B>See Also:</B><DD><A HREF="Mappy.html#setY(int)"><CODE>setY(int)</CODE></A>, <A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getY()"><!-- --></A><H3>
getY</H3>
<PRE>
public int <B>getY</B>()</PRE>
<DL>
<DD>Returns the Y coordinate of the current Map layer, in pixels. <br> <br> I'm thinking of renaming this method to <code>getPixelY()</code> to be more in line with <code>getBlockY()</code>. <br>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the Y coordinate of the current Map layer, in pixels.<DT><B>See Also:</B><DD><A HREF="Mappy.html#addY(int)"><CODE>addY(int)</CODE></A>, <A HREF="Mappy.html#setY(int)"><CODE>setY(int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getBlockX()"><!-- --></A><H3>
getBlockX</H3>
<PRE>
public int <B>getBlockX</B>()</PRE>
<DL>
<DD>Returns the X coordinate of the current Map layer, in Blocks. <br> <br> This is effectively <code>getX() / getBlockWidth()</code>. <br>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the X coordinate of the current Map layer, in Blocks.<DT><B>See Also:</B><DD><A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A>, <A HREF="Mappy.html#getBlockWidth()"><CODE>getBlockWidth()</CODE></A>, <A HREF="Mappy.html#getBlock(int, int)"><CODE>getBlock(int, int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getBlockY()"><!-- --></A><H3>
getBlockY</H3>
<PRE>
public int <B>getBlockY</B>()</PRE>
<DL>
<DD>Returns the Y coordinate of the current Map layer, in Blocks. <br> <br> This is effectively <code>getY() / getBlockHeight()</code>. <br>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the Y coordinate of the current Map layer, in Blocks.<DT><B>See Also:</B><DD><A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A>, <A HREF="Mappy.html#getBlockHeight()"><CODE>getBlockHeight()</CODE></A>, <A HREF="Mappy.html#getBlock(int, int)"><CODE>getBlock(int, int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="animateBlocks()"><!-- --></A><H3>
animateBlocks</H3>
<PRE>
public void <B>animateBlocks</B>()</PRE>
<DL>
<DD>Animates all the animation block structures. <br>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="drawBackground(java.awt.Graphics, boolean)"><!-- --></A><H3>
drawBackground</H3>
<PRE>
public void <B>drawBackground</B>(java.awt.Graphics gfx, boolean blnTransparency)</PRE>
<DL>
<DD>Draws the Blocks' background of the current Map layer. <br> <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>gfx</CODE> - the <code>Graphics</code> object that the Map is to drawn on.<DD><CODE>blnTransparency</CODE> - whether or not the background is to be drawn with transparency or not.<DT><B>See Also:</B><DD><A HREF="Mappy.html#drawForeground(java.awt.Graphics, int)"><CODE>drawForeground(Graphics, int)</CODE></A>, <A HREF="Mappy.html#setCurrentMapLayer(int)"><CODE>setCurrentMapLayer(int)</CODE></A>, <A HREF="Mappy.html#setScreenDimensions(java.awt.Rectangle)"><CODE>setScreenDimensions(Rectangle)</CODE></A>, <A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A>, <A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="drawForeground(java.awt.Graphics, int)"><!-- --></A><H3>
drawForeground</H3>
<PRE>
public void <B>drawForeground</B>(java.awt.Graphics gfx, int intBlockLayer)</PRE>
<DL>
<DD>Draws the Blocks' foreground of the current Map layer. <br> <br> If <code>intBlockLayer</code> is unknown then an error is logged (not thrown). <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>gfx</CODE> - the <code>Graphics</code> object that the Map is to drawn on.<DD><CODE>intBlockLayer</CODE> - the Block's foreground layer to be drawn.<DT><B>See Also:</B><DD><A HREF="Mappy.html#drawBackground(java.awt.Graphics, boolean)"><CODE>drawBackground(Graphics, boolean)</CODE></A>, <A HREF="Mappy.html#setCurrentMapLayer(int)"><CODE>setCurrentMapLayer(int)</CODE></A>, <A HREF="Mappy.html#setScreenDimensions(java.awt.Rectangle)"><CODE>setScreenDimensions(Rectangle)</CODE></A>, <A HREF="Mappy.html#getX()"><CODE>getX()</CODE></A>, <A HREF="Mappy.html#getY()"><CODE>getY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getBlock(int, int)"><!-- --></A><H3>
getBlock</H3>
<PRE>
public <A HREF="Mappy.Block.html">Mappy.Block</A> <B>getBlock</B>(int intBlockX, int intBlockY)</PRE>
<DL>
<DD>Returns the <code>Block</code> used at the given <code>Block</code> coordinates, in the current Map layer. <br> <br> The returned <code>Block</code> is <b>not</b> independant of the Map, so any changes made to the block are immediatly reflected in the Map. Also remember that there is not one <code>Block</code> for each given coordinate but that each coordinate points to a <code>Block</code>. i.e. <code>Blocks</code> are reused throughout the Map. <br> <br> If any of the <code>Block</code> coordinates given are out of range then an error is logged (not thrown) and <code>null</code> returned. <br> <br>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the <code>Block</code> used at the given coordinate.<DT><B>See Also:</B><DD><A HREF="Mappy.html#setCurrentMapLayer(int)"><CODE>setCurrentMapLayer(int)</CODE></A>, <A HREF="Mappy.html#getBlockX()"><CODE>getBlockX()</CODE></A>, <A HREF="Mappy.html#getBlockY()"><CODE>getBlockY()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setBlock(int, int, int)"><!-- --></A><H3>
setBlock</H3>
<PRE>
public void <B>setBlock</B>(int intBlockX, int intBlockY, int intIndex)</PRE>
<DL>
<DD>Puts the block structure value in the map at the given block coords. negative values are animations (-1 is the first anim).
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="collisionDetection(int, int)"><!-- --></A><H3>
collisionDetection</H3>
<PRE>
public boolean <B>collisionDetection</B>(int intX, int intY)</PRE>
<DL>
<DD>Performs a collision detection test at the given pixel coordinates using the <code>Block</code>'s collision flags. <br> <br> If any of the pixel coordinates are out of range of the map then <code>false</code> is automatically returned. <br> <br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>intX</CODE> - the pixel X coordinate.<DD><CODE>intY</CODE> - the pixel Y coordinate.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_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>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -