Dubbsta
Active member
- Joined
- Jul 13, 2017
- Messages
- 208
i cant figure out how to work input correctly. in the getchar example it never breaks it just keeps typing. im trying to get the number of frames or type names and use it. this is what my code looks like ...also how to do backspace/delete char thanks
Cerberus:
Class Layer
Field map:Map
Field tileset:TileSet
Field visible:Bool = True
Field name:String
Field frames:String
Field last:Int
Field dir:string
Field filter:String = "Image Files:png,jpg,bmp"
Field imgname:String
Field numframes:int
Method getimg:String( )
dir = RequestFile("select an image",filter)
last = dir.FindLast("\")+1
name = dir[last..]
Return name
End
Method getframes:int()
Local char:int = GetChar()
frames += String.FromChar(char)
'Return 1
return Int(frames)
End
Method createLayer:Void( )
imgname = getimg()
numframes = getframes()
If img <> Null
map = New Map()
tileset = New TileSet("tiles/"+imgname ,numframes)
End
Method draw:Void()
If map <> Null
map.draw()
tileset.draw()
End
End
End