Image Mask

BlitzMax Forums/BlitzMax Beginners Area/Image Mask

It not works ='(

Here the code i use:

Graphics 640,480,16

SetMaskColor 225,0,255
Global gfx_image:TImage = LoadImage("media\player.png",MASKEDIMAGE)

Type player
Field x#,y#
Field image:TImage

Global playerList:TList

Function Create(x#,y#)
If playerList = Null Then playerList =CreateList()
p:player = New player
ListAddLast playerList,p
p.x# = x#
p.y# = y#
p.image = gfx_image
End Function

Function Update()
If playerList Then
For p:player = EachIn playerList
DrawImage p.image,p.x#,p.y#
Next
EndIf
End Function
End Type

player.Create(300,200)

Repeat

player.Update

Flip
Cls

Until KeyHit(KEY_ESCAPE) Or AppTerminate()