📄 loader.html
字号:
myMesh = (<span class="example_class">Mesh</span>) roots[0];} <span class="example_comment">// Turn on perspective correction for the Mesh.</span> <span class="example_class">Appearance</span> a = myMesh.getAppearance(0); <span class="example_comment">// get the appearance of the mesh</span><span class="example_class">PolygonMode</span> p = a.getPolygonMode(); <span class="example_comment">// get its polygon attributes</span>p.setPerspectiveCorrectionEnable(<span class="example_literal">true</span>); <span class="example_comment">// enable perspective correction</span> <span class="example_comment">// Find a specific Camera node in the World, and set it as the currently</span><span class="example_comment">// active camera in the world. We've previously assigned the userID "10"</span><span class="example_comment">// to that camera node.</span> <span class="example_class">Camera</span> myCamera = (<span class="example_class">Camera</span>) myWorld.find(10);myWorld.setActiveCamera(myCamera); <span class="example_comment">// Load an individual PNG file.</span> <span class="example_class">Image</span>2D textureImage=<span class="example_literal">null</span>; <span class="example_control">try</span> { textureImage = (<span class="example_class">Image</span>2D)<span class="example_class">Loader</span>.load(<span class="example_string">"/texture.png"</span>)[0];} <span class="example_control">catch</span>(<span class="example_class">IOException</span> e) { <span class="example_comment">// couldn't load the PNG file</span>}</pre></DD></DD></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== 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>static <A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Loader.html#load(byte[], int)">load</A></B>(byte[] data, int offset)</CODE>
<BR>
Deserializes Object3D instances from the given byte array, starting at the given offset. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Loader.html#load(java.lang.String)">load</A></B>(java.lang.String name)</CODE>
<BR>
Deserializes Object3D instances from the named resource. </TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ 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="load(java.lang.String)"><!-- --></A><H3>
load</H3>
<PRE>
public static <A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A>[] <B>load</B>(java.lang.String name) throws java.io.IOException</PRE>
<DL>
<DD><p>Deserializes Object3D instances from the named resource. The name of the resource is as defined by <code>Class.getResourceAsStream(name)</code>, or a URI. The types of data that can be loaded with this method are defined in the class description.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - name of the resource to load from<DT><B>Returns:</B><DD>an array of newly created Object3D instances<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>name</code> is null<DD><CODE>java.io.IOException</CODE> - if <code>name</code>, or any resource referenced from it, cannot be resolved or accessed<DD><CODE>java.io.IOException</CODE> - if the data in <code>name</code>, or in any resource referenced from it, is not in accordance with the M3G and PNG file format specifications<DD><CODE>java.lang.SecurityException</CODE> - if the application does not have the security permission to open a connection to load the data</DL>
</DD>
</DL>
<HR>
<A NAME="load(byte[], int)"><!-- --></A><H3>
load</H3>
<PRE>
public static <A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A>[] <B>load</B>(byte[] data, int offset) throws java.io.IOException</PRE>
<DL>
<DD><p>Deserializes Object3D instances from the given byte array, starting at the given offset. The types of data that can be loaded with this method are defined in the class description. The byte array must not contain any relative references (such as "/pics/texture.png"), but complete URIs are allowed.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - byte array containing the serialized objects to load<DD><CODE>offset</CODE> - index at which to start reading the <code>data</code> array<DT><B>Returns:</B><DD>an array of newly created Object3D instances<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>data</code> is null<DD><CODE>java.io.IOException</CODE> - if any external references in <code>data</code> cannot be resolved or accessed<DD><CODE>java.io.IOException</CODE> - if the data in <code>data</code>, or in any resource referenced from it, is not in accordance with the M3G and PNG file format specifications<DD><CODE>java.lang.SecurityException</CODE> - if the application does not have the security permission to open a connection to load an external reference</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/Loader.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/Light.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/Material.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="Loader.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 | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <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 + -