📄 scriptapp.html
字号:
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Show<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Hide<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>MoveTo<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>MoveBy<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>dx, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>dy<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>ResizeTo<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>ResizeBy<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>dx, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>dy<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>GroupID<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>GroupID<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>id<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>ItemID<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>ItemID<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>id<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>AutoSize<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Bitmap<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">const </FONT></SPAN>Bitmap<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>bitmap<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Bitmap<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>Bitmap<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Offset<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">}</SPAN></FONT></PRE><H2 CLASS="western">
<FONT FACE="arial">class Bitmap</FONT></H2>
<PRE STYLE="margin-bottom: 0.5cm"><SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">import </FONT></SPAN>Bitmap;</PRE><P CLASS="western">
<FONT COLOR="#000000"><FONT FACE="arial"><SPAN STYLE="background: #ffffff">An
object that encapsulates a PNG image, loaded from disk. If the
specified image contains an alpha channel,<BR>you must set <I>useAlpha</I>
to <I>true</I> in order to correctly display the image. If the
specified image does not contain an<BR>alpha channel, you should set
it to <I>false</I> for better drawing speed.</SPAN></FONT></FONT></P>
<PRE><SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">class </FONT></SPAN>Bitmap
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">{</SPAN></FONT>
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Bitmap<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">const string</FONT><FONT COLOR="#000000">& </FONT></SPAN>filename, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>useAlpha<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>Mode<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>Width<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>Height<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>HitAt<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>HitThreshold<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>n<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">}</SPAN></FONT></PRE><H2 CLASS="western">
<FONT FACE="arial">class Sound</FONT></H2>
<PRE STYLE="margin-bottom: 0.5cm"><SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">import </FONT></SPAN>Sound;</PRE><P CLASS="western">
<FONT COLOR="#000000"><FONT FACE="arial"><SPAN STYLE="background: #ffffff">This
is an object that encapsulates a DirectSound buffer. Specify the
filename of an uncompressed WAV file and<BR>the number of "voices"
the sound is allowed to simultanously play. The WAV file can be 8 or
16 bit, mono or stereo,<BR>and any sample rate. The volume parameter
in Play() and Loop() is expected to be specified in hundreds of
a<BR>decibel (-10000 = -inf dB, 0 = 0 dB). The pan parameter ranges
from -10000 (full left) to +10000 (full right).</SPAN></FONT></FONT></P>
<PRE><SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">class </FONT></SPAN>Bitmap
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">{</SPAN></FONT>
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Sound<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">const string</FONT><FONT COLOR="#000000">& </FONT></SPAN>filename, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long </FONT></SPAN>numVoices<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff"> method </FONT></SPAN>Play<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long </FONT></SPAN>volume, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long </FONT></SPAN>pan<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff"> method </FONT></SPAN>Loop<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long </FONT></SPAN>volume, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long </FONT></SPAN>pan<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff"> method </FONT></SPAN>Stop<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff"> accessor long </FONT></SPAN>playing<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">}</SPAN></FONT></PRE><H2 CLASS="western">
<FONT FACE="arial">class Screen</FONT></H2>
<PRE STYLE="margin-bottom: 0.5cm"><SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">import </FONT></SPAN>Screen;</PRE><P CLASS="western">
<FONT COLOR="#000000"><FONT FACE="arial"><SPAN STYLE="background: #ffffff">The
main window of the ScriptApp application exports itself as an
instance of class <I>Screen</I> to JewelScript. When<BR>the ScriptApp
calls the <I>CreateApplet()</I> function, it passes a reference to
this instance as a parameter. The applet<BR>can store this reference
and use it to call the methods declared below.</SPAN></FONT></FONT></P>
<PRE><SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">class </FONT></SPAN>Screen
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">{</SPAN></FONT>
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>Width<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method long </FONT><FONT COLOR="#000000"> </FONT></SPAN>Height<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>BackColor<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>r, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>g, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>b<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Redraw<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>AddLayer<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">const </FONT></SPAN>Layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>RemoveLayer<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">const </FONT></SPAN>Layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>LayerAt<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>LayerCollision<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">const </FONT></SPAN>Layer<SPAN STYLE="background: #ffffff"><FONT COLOR="#000000">& </FONT></SPAN>layer, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> startIndex</FONT><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>RemoveAllLayers<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">()</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>FixedSize<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">method </FONT></SPAN>Offset<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">(</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>x, <SPAN STYLE="background: #ffffff"><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> </FONT></SPAN>y<SPAN STYLE="background: #ffffff"><FONT COLOR="#ff0000">)</FONT></SPAN>;
<FONT COLOR="#ff0000"><SPAN STYLE="background: #ffffff">}</SPAN></FONT></PRE>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -