5/10/2023 0 Comments Dwarf fortress tileset fontBearLibTerminal uses the Unicode plane for tiles. Now there is a bit tricky part about using bitmap tilesets as a font. To remove the loaded tilesets, you just have to say that there is nothing in the slots: The number specified as the starting code point identifies the tile or tileset. A single tile is just a small tileset with one image. There is no difference between a tileset and a tile. In the example above there will be four tiles assigned to character points 0x1000 through 0x1003. By default the tiles are placed into consecutive slots. The order BeralibTerminal iterates over them is fixed: row by row, from left to right. The library will slice the bitmap up into pieces and assign them to the character code points. The only difference is that you have to specify a size of a single image in the tileset bitmap. It is loaded in almost the same way as a single tile: Lets say a tileset contains four tiles, each of them is 16×16 pixels in size. BearLibTerminal allows loading whole tilesets at once. Whats more, each tile in a stack can have its own offset from the default position in a cell.Īssigning images one slot at a time is tedious and positively counterproductive. Note that each tile in a stack can have its own color. Because the library takes full advantage of alpha (transparency) channel of tile images, this effectively allows to combine several images into one, constructing them on the fly instead of preparing tiles for every combination beforehand. For a simple game you might not need more than one layer, but sometimes they can be indispensable.Įach cell, in turn, can store a number of tiles. To be precise, a scene is not a single grid, but a number of them, called layers. Instead, you get a grid of cells which can be addressed independently, a scene. You don't get a continuous in/out streams to write to and to read from. However, the way it works is different from a console. Spot the differences with the original ones =) Here is what the BearLibTerminal window may look like. The main purpose of the BearLibTerminal library is (or at least, it was) to provide user with a window impersonating the system console, but much more customizable and geared more toward the game development.
0 Comments
Leave a Reply. |