I'm trying to make a basic tile editor:
I've made a type that should create the set amount of tiles right from the start, then if I wanted to change the tiles all I would do is click on it and it would change the frame of that particular tile (rather than create a new tile). But it doesn't work, apparently the image inside of the Draw() method is null... I'm lost. Anyone know how to get this working? All it needs to do is fill the screen with frame 0 of the tileset:
-Thanks
SuperStrict Const tsx:Int=32 'width of each tile Const tsy:Int=32 'height of each tile Const tfrms:Int=7 '# of frames in the tile set Const timg$="C:\Program Files\BlitzMax\MyBMX\Graphics Library\tileset.png" 'the tile set image Const tnumx:Int=20 '# of tiles across on your map Const tnumy:Int=15 '# of tiles down on your map Local map:tile=tile.Create(tsx,tsy,timg$,tnumx,tnumy,tfrms) While Not KeyHit(KEY_ESCAPE) Local t:tile For t=EachIn tile.list t.Draw() Next Flip;Cls Wend End Type tile Field tx:Int,ty:Int,tfrm:Int 'individual tile properties: x/y/frame Field tsx:Int,tsy:Int,tfrms:Int,tset:TImage,tnumx:Int,tnumy:Int 'map properties Global list:TList=New TList Method Draw() SetColor(255,255,255) DrawImage(tset,tx,ty,tfrm) End Method Method New() list.AddLast(Self) End Method Function Create:tile(tsx:Int,tsy:Int,timg$,tnumx:Int,tnumy:Int,tfrms:Int) Local tset:TImage=LoadAnimImage(timg$,tsx,tsy,0,tfrms) For Local i:Int=1 To tnumx For Local j:Int=1 To tnumy Local t:tile=New tile t.tx=j*tsx t.ty=i*tsy t.tfrm=0 Return t Next Next End Function End Type
I've made a type that should create the set amount of tiles right from the start, then if I wanted to change the tiles all I would do is click on it and it would change the frame of that particular tile (rather than create a new tile). But it doesn't work, apparently the image inside of the Draw() method is null... I'm lost. Anyone know how to get this working? All it needs to do is fill the screen with frame 0 of the tileset:

-Thanks