Add files via upload

This commit is contained in:
arc1tec4
2024-12-11 14:14:00 -07:00
committed by GitHub
parent 38021bf1fa
commit d7b1440917
20 changed files with 1087 additions and 4 deletions

View File

@@ -5,4 +5,38 @@ Changes the image source for a sprite frame sheet
Note: This needs to be the same size as the current image source or you will have rendering issues
#code
isFullScreen = false
vSync = true
winWidth = 640
winHeight = 480
canViewPortX = 0
canViewPortY = 0
OpenWindow("SetSpriteSource", winWidth, winHeight, isFullScreen, vSync)
sCanvas = OpenCanvasSpriteLayer(canViewPortX, canViewPortY, winWidth, winHeight)
Canvas(sCanvas)
DIM frown
DIM frownW
DIM frownH
frowny1 = LoadImage("frowny1.png")
frowny2 = LoadImage("frowny2.png")
GetImageSize(frown, frownW, frownH)
frownSprite = CreateSprite(frown, frownW, frownH)
SetSpritePosition(frownSprite, 100, 100)
While Not Key(K_ESCAPE)
If KEY(K_SPACE) Then
SetSpriteSource(frownSprite, frowny2)
End If
Update()
Wend
#/code
#image "images/frowny1.png"
#image "images/frowny2.png"
#ref GetSpriteSource