About Monkey 2 › Forums › Monkey 2 Projects › FontMap Level Creator Released
This topic contains 5 replies, has 3 voices, and was last updated by
Abe _King_
1 year, 4 months ago.
-
AuthorPosts
-
December 8, 2017 at 3:10 pm #12201
The first version (V1.04) has now been released:

this can be downloaded along with full file information here:
FontMap V1.04This allows multiple map with different resolutions to be created.
Monkey2 source is included for use in your own projectsDecember 9, 2017 at 7:30 am #12204Here is the FileFormat details:
– header –
(4 bytes) int = -9999(4 bytes) int = number of layers
– layer data –
(4 bytes) int = width of layer (0 aligned)(4 bytes) int = height of layer (0 aligned)
starting from top left, data is read down the height, then across to the next x cell and continues down until all data is read
– cell data –
(2 bytes) short = map character (referencing the character font)(2 bytes) short = color reference (referencing the color palette)
and here is the monkey2 code to read in the data
[/crayon]Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455[crayon-5cb9c87a706ee455493970 inline="true" ] 'a map file can contain up to 32 maps with a resolution of 128x128field _tileMap:short[, , ] = New short[32, 128, 128]field _colorMap:short[, , ] = New short[32, 128, 128]method Load( filePath:string )Print "loading..."Local fStream:Stream = Stream.Open( filePath, "r" )If not fStream ThenPrint filePath + " not opened"ReturnEnd Iflocal id:int = fStream.ReadInt()If id <> -9999 ThenPrint filePath + " ID error"fStream.Close()ReturnEnd Iflocal layers:int = fStream.ReadInt()Local k:intFor k = _mapLayer To _mapLayer+layers-1If k < 32 ThenLoadLayer( fStream, k )End IfNextfStream.Close()End methodmethod LoadLayer( Stream:Stream, layer:int )_loadX = Stream.ReadInt()_loadY = Stream.ReadInt()Print "layer "+layer+" size is "+(_loadX+1)+" "+(_loadY+1)Local rt:shortLocal cl:shortLocal x:intLocal y:intFor x = 0 To _loadXFor y = 0 To _loadYcl = Stream.ReadShort()rt = Stream.ReadShort()If x < 128 And y < 128 Then_tileMap[ layer, x, y] = Clamp( int(cl), 0, 255 )_colorMap[ layer, x, y] = Clamp( int(rt), 0, 255 )End ifNextNextend methodDecember 9, 2017 at 2:03 pm #12207Great!
December 9, 2017 at 5:39 pm #12208I like it! It looks like a very straightforward app to use.
I have some questions/suggestions:
– Are you going to be adding many more convenience features?
– Are you going to be considering non-tiled map features?
– Would you add multi-level management? IE: Easily keep reusable things between multiple level filesThe biggest thing for me is probably non tiled like features! Then maybe down the road a polygon editor of sorts.
December 11, 2017 at 6:56 am #12234convenience features
What have you in mind?
Easily keep reusable things between multiple level files
Again, what are your suggestions on this?
non-tiled map features?
Such as?
December 11, 2017 at 6:15 pm #12238Sorry for the vagueness! I took a look at your project, pretty nice! Hope to make something of this caliber in the future myself :). The color selection wasn’t updating after a while of clicking through the gradients for some reason though. Also, sometimes the view would get extremely stretched by changing the xres or yres until I pressed the “layer” or “square” button.
So convenience features would be like:
– Select a group of tile then, using a rectangle tool, have that selection repeated through the rectangle or even some varient of a nine slice drag?
– Fill tool
those are just for startersNon-tiled features would be like:
– Elements not aligned to a grid
– Elements which can be rotated and scaledMulti-level management:
– would be like a project in an ide
– have all resources used in the files found in the project in memory while working between maps, or making new onesGood luck with your project
-
AuthorPosts
You must be logged in to reply to this topic.