From 5ff184aff646217ffe743d7215c9784e09694545 Mon Sep 17 00:00:00 2001 From: arc1tec4 Date: Tue, 12 Nov 2024 18:47:06 -0700 Subject: [PATCH] Fleshed out createsprite DOC --- doc/doc_files/createsprite.html | 37 +++++++++++++++++++++++++++++++- doc/doc_files/theEye.png | Bin 0 -> 888 bytes 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 doc/doc_files/theEye.png diff --git a/doc/doc_files/createsprite.html b/doc/doc_files/createsprite.html index d83eab9..d92a5ce 100644 --- a/doc/doc_files/createsprite.html +++ b/doc/doc_files/createsprite.html @@ -9,7 +9,42 @@

function CreateSprite( img )

- Returns new sprite + This function returns a new sprite which you can place in a variable for use in your program. +

+

+ Here is an example of opening a sprite canvas layer, creating a sprite, setting it's position and finally displaying it. +

+

+ isFullScreen = false 
+ vSync = true 
+ winWidth = 640 
+ winHeight = 480 
+ canViewPortX = 0 
+ canViewPortY = 0 
+   
+ OpenWindow("CreateSprite", winWidth, winHeight, isFullScreen, vSync) 
+ sCanvas = OpenCanvasSpriteLayer(canViewPortX, canViewPortY, winWidth, winHeight) 
+ Canvas(sCanvas) 
+   
+ DIM eye 
+ DIM eyeW 
+ DIM eyeH 
+   
+ eye = LoadImage("theEye.png") 
+ GetImageSize(eye, eyeW, eyeH) 
+   
+ eyeSprite = CreateSprite(eye, eyeW, eyeH) 
+ SetSpritePosition(eyeSprite, 100100) 
+   
+ While Not Key(K_ESCAPE) 
+ 'ClearCanvas() For a sprite layer canvas, you don't need to call ClearCanvas. It's automatically called.
+ Update()      'Update automatically deals with drawing the sprites on the sprite canvas.
+ Wend 
+

+

+

Related: + OpenCanvasSpriteLayer + SetSpritePosition

diff --git a/doc/doc_files/theEye.png b/doc/doc_files/theEye.png new file mode 100644 index 0000000000000000000000000000000000000000..b14eb0c56a9db6aaf46e14c1574f28994387a6d7 GIT binary patch literal 888 zcmV-;1Bd*HP)P001Ni1^@s6d<~Hh00009a7bBm000jX z000jX0U?|6GXMYsDoI2^R7i>Kl}$(#VHn4MQ^P94$}YyjR3^pdg5pZxMU;hd#UlD3 zC@Kk}h`>V~>R_-)ga|?d7tMI_zN67d_+yP-qYD3q`Q}P6CmJl7>4s6G$rl#g+k0sO)@+< z06-)XNwT?ZEs~9Zm~J!RaHt-ah`ae^(%#pMJphygeWvx{!2vZQ|aI1yLLZTDQo~s7nbj@uF^D-E@ z`&c6}oh{7YA15oW#O>c@d8{06RY8l4qzeB@$d7*?CV6h{nf@e*fvV$jv{UHJ09^+~K}q+@5|@AzLz4i!DA@E6CcPiz4FlB zPrM$&AOX#Vou)Hl|KhTM9ZNInURlxx{tB)X=MqtrRnmAhem^#DjBRtz2)3O8^bcX} zD_fr@0f$5FURlD3ksWomz=vOH0phREymJle8Ud{{0(=fN03e44lDeY^pa;51Sy&w} z81D0Tx6q_40FWOFQC?PNF+MXjNl#}7PNx==RP9#)c#^+E1ufuaC3qejYReEug7 zg}AL$hRxWLm{<^SI8^iNOYOF_^FM_}iN__9SoRaK*8Z9#pe3aK;#3Cpgk2ZOW*}uh z(G}>b)=Oeha$(|&09tH3F401`VI*t8T&*{aWYeHmgY{rbl>8_8EBpc@*f&VJYKBAr O0000