User Tools

Site Tools


agxsimpleexamples

Differences

This shows you the differences between two versions of the page.


agxsimpleexamples [2023/03/19 13:58] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Simple examples ======
  
 +===== Displaying an image to screen =====
 +
 +This simple example load an image, display it on screen and free image before exit.\\
 +This use the 2d API of Antiryad Gx.
 +
 +<html>
 +<!--
 +class init
 +
 +import antiryadgx.gx_bitmap
 +import antiryadgx.gx_screen
 +
 +declarefunction nothing,main,nothing
 +
 +function main
 +  dim ptr_tbitmap,gx_tbitmap //Declare image pointer
 +
 +  ptr_tbitmap=gx_bitmap::loadall(string::"image.mtd") //Load mtd image
 +
 +  gx_screen::clear() //Clear video buffer
 +  gx_screen::drawbitmap(0,0,ptr_tbitmap,gx_bitmap_drawflat,255,255,255,255) //Write image to video buffer at (0,0) position
 +  gx_screen::flush() //Draw video buffer to screen
 +
 +  ptr_tbitmap->free() //Free image
 +
 +  return
 +endfunction
 +
 +-->
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">class</font><font size="3" color="#0000ff">&nbsp;</font>init</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">import</font><font size="3" color="#0000ff">&nbsp;</font>antiryadgx<font size="3" color="#0000ff">.</font>gx_bitmap</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">import</font><font size="3" color="#0000ff">&nbsp;</font>antiryadgx<font size="3" color="#0000ff">.</font>gx_screen</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">declarefunction</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">nothing</font><font size="3" color="#0000ff">,</font>main<font size="3" color="#0000ff">,</font><font size="3" color="#0000ff">nothing</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">function</font><font size="3" color="#0000ff">&nbsp;</font>main</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">dim</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tbitmap<font size="3" color="#0000ff">,</font>gx_tbitmap<font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Declare&nbsp;image&nbsp;pointer</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tbitmap<font size="3" color="#0000ff">=</font>gx_bitmap<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>loadall<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">string</font><font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font><font size="3" color="#008080">"image.mtd"</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Load&nbsp;mtd&nbsp;image</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>gx_screen<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>clear<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Clear&nbsp;video&nbsp;buffer</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>gx_screen<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>drawbitmap<font size="3" color="#0000ff">(</font><font size="3" color="#ff0000">0</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">0</font><font size="3" color="#0000ff">,</font>ptr_tbitmap<font size="3" color="#0000ff">,</font>gx_bitmap_drawflat<font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Write&nbsp;image&nbsp;to&nbsp;video&nbsp;buffer&nbsp;at&nbsp;(0,0)&nbsp;position</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>gx_screen<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>flush<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Draw&nbsp;video&nbsp;buffer&nbsp;to&nbsp;screen</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tbitmap<font size="3" color="#0000ff">-</font><font size="3" color="#0000ff">&gt;</font>free<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Free&nbsp;image</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">return</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">endfunction</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +</tt>
 +</html>
 +
 +===== Using animatedsprite =====
 +
 +<html>
 +<!--
 +/* ---------------------- */
 +/* Animatedsprite example */
 +/* ---------------------- */
 +
 +class init
 +
 +import antiryadgx.gx_animatedsprite
 +import antiryadgx.gx_bitmap
 +import antiryadgx.gx_screen
 +
 +declarefunction nothing,main,nothing
 +
 +/* ---- */
 +/* main */
 +/* ---- */
 +function main
 +  dim ptr_tanimatedsprite,gx_tanimatedsprite //Declare animatedprite pointer
 +
 +  ptr_tanimatedsprite=gx_animatedsprite_load(string::"sprite.spr")
 +
 +  ptr_tanimatedsprite->initiate()
 +  while(1,==,1)
 +    gx_screen::clear() //Clear video buffer
 +    gx_screen::drawbitmap(0,0,ptr_tanimatedsprite->getcurrentbitmap(),gx_bitmap_drawflat,255,255,255,255) //Write animatedsprite to video buffer at (0,0) position
 +    gx_screen::flush() //Draw video buffer to screen
 +
 +    ptr_tanimatedsprite->manage() //Update animatedsprite
 +    if(ptr_tanimatedsprite->islooped(),!=,0) //Check if animation looped
 +      break //Break the loop
 +    endif
 +  wend
 +
 +  ptr_tanimatedsprite->free() //Free animatedsprite
 +
 +  return
 +endfunction
 +
 +-->
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#008000">/*&nbsp;----------------------&nbsp;*/</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#008000">/*&nbsp;Animatedsprite&nbsp;example&nbsp;*/</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#008000">/*&nbsp;----------------------&nbsp;*/</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">class</font><font size="3" color="#0000ff">&nbsp;</font>init</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">import</font><font size="3" color="#0000ff">&nbsp;</font>antiryadgx<font size="3" color="#0000ff">.</font>gx_animatedsprite</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">import</font><font size="3" color="#0000ff">&nbsp;</font>antiryadgx<font size="3" color="#0000ff">.</font>gx_bitmap</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">import</font><font size="3" color="#0000ff">&nbsp;</font>antiryadgx<font size="3" color="#0000ff">.</font>gx_screen</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">declarefunction</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">nothing</font><font size="3" color="#0000ff">,</font>main<font size="3" color="#0000ff">,</font><font size="3" color="#0000ff">nothing</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#008000">/*&nbsp;----&nbsp;*/</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#008000">/*&nbsp;main&nbsp;*/</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#008000">/*&nbsp;----&nbsp;*/</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">function</font><font size="3" color="#0000ff">&nbsp;</font>main</font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">dim</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tanimatedsprite<font size="3" color="#0000ff">,</font>gx_tanimatedsprite<font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Declare&nbsp;animatedprite&nbsp;pointer</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tanimatedsprite<font size="3" color="#0000ff">=</font>gx_animatedsprite_load<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">string</font><font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font><font size="3" color="#008080">"sprite.spr"</font><font size="3" color="#0000ff">)</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tanimatedsprite<font size="3" color="#0000ff">-</font><font size="3" color="#0000ff">&gt;</font>initiate<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">while</font><font size="3" color="#0000ff">(</font><font size="3" color="#ff0000">1</font><font size="3" color="#0000ff">,</font><font size="3" color="#0000ff">=</font><font size="3" color="#0000ff">=</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">1</font><font size="3" color="#0000ff">)</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>gx_screen<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>clear<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Clear&nbsp;video&nbsp;buffer</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>gx_screen<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>drawbitmap<font size="3" color="#0000ff">(</font><font size="3" color="#ff0000">0</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">0</font><font size="3" color="#0000ff">,</font>ptr_tanimatedsprite<font size="3" color="#0000ff">-</font><font size="3" color="#0000ff">&gt;</font>getcurrentbitmap<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">,</font>gx_bitmap_drawflat<font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">2</font><font size="3" color="#ff0000">5</font><font size="3" color="#ff0000">5</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Write&nbsp;animatedsprite&nbsp;to&nbsp;video&nbsp;buffer&nbsp;at&nbsp;(0,0)&nbsp;position</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>gx_screen<font size="3" color="#0000ff">:</font><font size="3" color="#0000ff">:</font>flush<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Draw&nbsp;video&nbsp;buffer&nbsp;to&nbsp;screen</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tanimatedsprite<font size="3" color="#0000ff">-</font><font size="3" color="#0000ff">&gt;</font>manage<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Update&nbsp;animatedsprite</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">if</font><font size="3" color="#0000ff">(</font>ptr_tanimatedsprite<font size="3" color="#0000ff">-</font><font size="3" color="#0000ff">&gt;</font>islooped<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">,</font><font size="3" color="#0000ff">!</font><font size="3" color="#0000ff">=</font><font size="3" color="#0000ff">,</font><font size="3" color="#ff0000">0</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Check&nbsp;if&nbsp;animation&nbsp;looped</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">break</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Break&nbsp;the&nbsp;loop</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">endif</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">wend</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font>ptr_tanimatedsprite<font size="3" color="#0000ff">-</font><font size="3" color="#0000ff">&gt;</font>free<font size="3" color="#0000ff">(</font><font size="3" color="#0000ff">)</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#008000">//Free&nbsp;animatedsprite</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">&nbsp;</font><font size="3" color="#0000ff">return</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"><font size="3" color="#0000ff">endfunction</font></font></tt>
 +<br/>
 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><font size="3" color="#000000"></font></tt>
 +<br/>
 +</tt>
 +</html>