Add files via upload
This commit is contained in:
@@ -3,5 +3,51 @@
|
||||
|
||||
Returns the frame height of a sprite
|
||||
|
||||
#code
|
||||
isFullScreen = false
|
||||
vSync = true
|
||||
winWidth = 640
|
||||
winHeight = 480
|
||||
canViewPortX = 0
|
||||
canViewPortY = 0
|
||||
|
||||
OpenWindow("SpriteHeight", winWidth, winHeight, isFullScreen, vSync)
|
||||
pCanvas = OpenCanvas(200, 80, 0, 0, 200, 80, 1) 'Need to open a canvas for drawing the text
|
||||
sCanvas = OpenCanvasSpriteLayer(canViewPortX, canViewPortY, winWidth, winHeight)
|
||||
Canvas(sCanvas)
|
||||
|
||||
DIM eye
|
||||
DIM eyeW
|
||||
DIM eyeH
|
||||
DIM eSpriteHeight
|
||||
|
||||
DIM font1
|
||||
|
||||
Font1 = LoadFont("DripOctober.ttf", 16)
|
||||
SetFont(Font1)
|
||||
SetColor(RGB(100, 200, 200))
|
||||
|
||||
eye = LoadImage("theEye.png")
|
||||
GetImageSize(eye, eyeW, eyeH)
|
||||
|
||||
eyeSprite = CreateSprite(eye, eyeW, eyeH)
|
||||
SetSpritePosition(eyeSprite, 100, 100)
|
||||
|
||||
eSpriteHeight = SpriteHeight(eyeSprite)
|
||||
|
||||
While Not Key(K_ESCAPE)
|
||||
Canvas(pCanvas) 'change to the standard drawing canvas for drawing text
|
||||
DrawText("EyeSprite Height " + STR$(eSpriteHeight), 10, 50)
|
||||
|
||||
Update()
|
||||
Wend
|
||||
#/code
|
||||
|
||||
#image "images/theEye.png"
|
||||
|
||||
<br>
|
||||
<a href="../doc_files/images/DripOctober.ttf">Link to Font (It's locally on your computer, your not downloading anything from the internet)</a>
|
||||
<br>
|
||||
|
||||
#ref SpriteWidth GetSpriteSize
|
||||
|
||||
|
||||
Reference in New Issue
Block a user