📄 texture2d.html
字号:
the image means that the integer part of the texture coordinate is ignored and only the fractional part is used. This is equivalent to the <code>REPEAT</code> mode in OpenGL.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.Texture2D.WRAP_REPEAT">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Texture2D(javax.microedition.m3g.Image2D)"><!-- --></A><H3>
Texture2D</H3>
<PRE>
public <B>Texture2D</B>(<A HREF="../../../javax/microedition/m3g/Image2D.html">Image2D</A> image)</PRE>
<DL>
<DD><p>Constructs a new texture object with the given image, setting the texture attributes to their default values. The default values for the wrapping, filtering and blending attributes are as follows:</p> <ul> <li>wrapping S : <code>WRAP_REPEAT</code></li> <li>wrapping T : <code>WRAP_REPEAT</code></li> <li>level filter : <code>FILTER_BASE_LEVEL</code></li> <li>image filter : <code>FILTER_NEAREST</code></li> <li>blending mode : <code>FUNC_MODULATE</code></li> <li>blend color : 0x00000000 (transparent black)</li> </ul>
<P>
<DT><B>Parameters:</B><DD><CODE>image</CODE> - an Image2D object to set as the base level texture image<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>image</code> is null<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the width or height of <code>image</code> is not a positive power of two (1, 2, 4, 8, 16, etc.)<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the width or height of <code>image</code> exceeds the implementation defined maximum</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="setImage(javax.microedition.m3g.Image2D)"><!-- --></A><H3>
setImage</H3>
<PRE>
public void <B>setImage</B>(<A HREF="../../../javax/microedition/m3g/Image2D.html">Image2D</A> image)</PRE>
<DL>
<DD><p>Sets the given Image2D as the texture image of this Texture2D. Mipmap level images are generated automatically from the given Image2D, if and when necessary.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>image</CODE> - an Image2D object to set as the base level texture image<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>image</code> is null<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the width or height of <code>image</code> is not a positive power of two (1, 2, 4, 8, 16, etc.)<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the width or height of <code>image</code> exceeds the implementation defined maximum<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#getImage()"><CODE>getImage</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getImage()"><!-- --></A><H3>
getImage</H3>
<PRE>
public <A HREF="../../../javax/microedition/m3g/Image2D.html">Image2D</A> <B>getImage</B>()</PRE>
<DL>
<DD><p>Retrieves the current base level (full size) texture image.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current base level texture image<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#setImage(javax.microedition.m3g.Image2D)"><CODE>setImage</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setFiltering(int, int)"><!-- --></A><H3>
setFiltering</H3>
<PRE>
public void <B>setFiltering</B>(int levelFilter, int imageFilter)</PRE>
<DL>
<DD><p>Selects the filtering mode for this Texture2D. The available filtering modes are defined in the <a href="#filtering">class description</a>. Note that this setting is only a hint -- implementations may ignore it and choose a filtering method at their own discretion.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>levelFilter</CODE> - filtering between mipmap levels<DD><CODE>imageFilter</CODE> - filtering within a mipmap level<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>levelFilter</code> is not one of <code>FILTER_BASE_LEVEL, FILTER_NEAREST, FILTER_LINEAR</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>imageFilter</code> is not one of <code>FILTER_NEAREST, FILTER_LINEAR</code></DL>
</DD>
</DL>
<HR>
<A NAME="setWrapping(int, int)"><!-- --></A><H3>
setWrapping</H3>
<PRE>
public void <B>setWrapping</B>(int wrapS, int wrapT)</PRE>
<DL>
<DD><p>Sets the wrapping mode for the S and T texture coordinates.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>wrapS</CODE> - S texture coordinate wrapping mode<DD><CODE>wrapT</CODE> - T texture coordinate wrapping mode<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>wrapS</code> or <code>wrapT</code> is not one of <code>WRAP_CLAMP, WRAP_REPEAT</code></DL>
</DD>
</DL>
<HR>
<A NAME="getWrappingS()"><!-- --></A><H3>
getWrappingS</H3>
<PRE>
public int <B>getWrappingS</B>()</PRE>
<DL>
<DD><p>Returns the current texture wrapping mode for the S texture coordinate.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current S coordinate wrapping mode<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#setWrapping(int, int)"><CODE>setWrapping</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getWrappingT()"><!-- --></A><H3>
getWrappingT</H3>
<PRE>
public int <B>getWrappingT</B>()</PRE>
<DL>
<DD><p>Returns the current texture wrapping mode for the T texture coordinate.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current T coordinate wrapping mode<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#setWrapping(int, int)"><CODE>setWrapping</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setBlending(int)"><!-- --></A><H3>
setBlending</H3>
<PRE>
public void <B>setBlending</B>(int func)</PRE>
<DL>
<DD><p>Selects the texture blend mode, or blend function, for this Texture2D. The available blending modes are defined in the <a href="#blending">class description</a>.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>func</CODE> - the texture blending function to select<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>func</code> is not one of <code>FUNC_REPLACE, FUNC_MODULATE, FUNC_DECAL, FUNC_BLEND, FUNC_ADD</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#getBlending()"><CODE>getBlending</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getBlending()"><!-- --></A><H3>
getBlending</H3>
<PRE>
public int <B>getBlending</B>()</PRE>
<DL>
<DD><p>Returns the current texture blend mode for this Texture2D.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current texture blending function<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#setBlending(int)"><CODE>setBlending</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setBlendColor(int)"><!-- --></A><H3>
setBlendColor</H3>
<PRE>
public void <B>setBlendColor</B>(int RGB)</PRE>
<DL>
<DD><p>Sets the texture blend color for this Texture2D. The high order byte of the color value (that is, the alpha component) is ignored.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>RGB</CODE> - the new texture blend color in 0x00RRGGBB format<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#getBlendColor()"><CODE>getBlendColor</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getBlendColor()"><!-- --></A><H3>
getBlendColor</H3>
<PRE>
public int <B>getBlendColor</B>()</PRE>
<DL>
<DD><p>Returns the current texture blend color for this Texture2D. The high order byte of the color value (that is, the alpha component) is guaranteed to be zero.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current texture blend color in 0x00RRGGBB format<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Texture2D.html#setBlendColor(int)"><CODE>setBlendColor</CODE></A></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"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Texture2D.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-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-files/index-1.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><B>Nov 19, 2003</B></EM></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/m3g/Sprite3D.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/Transform.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="Texture2D.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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<EM>Copyright © 2003 Nokia Corporation. See the <a href="../../../overview-summary.html#Copyright">Copyright Notice</a> for details.</EM>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -