GithubHelp home page GithubHelp logo

godot-tileset-to-font's Introduction

Godot-TileSet-to-Font

A small script for converting 4.x tilesets to fonts

Usage:
Create a TileSet resource and load in your font texture as an Atlas.
(This works best if your source font file is a fixed grid.)
Add a Physics Layer and a Custom Data layer with one entry called "character", setting its type to String. image

You can load multiple font sizes in, each as a seperate atlas, to one TileSet. image

Make each character you'd like to put in your font into a tile. image

If you want your font to have variable width characters, add a collision polygon to your character.
As of right now, only the second vertex in the first collision shape is used.
(This is for an aesthetics reason so you can see the width of the character in the preview)
Move the second vertex to match the width of the character. You should include spacing if required. image

In the custom data layer, set the character field to match the tiles character, or whatever character you want.
This lets you set any unicode character to mean any glyph, allowing for extra tiles for icons and emoji. image

Add the FontCreator script to a node in your scene tree. Load in the TileSet into the Tiles property. Set the path you want to save the font to, or select a Resource to override it with. image

The FontPage resource contains the values you tweak between eaach font size.
image

TileSet index is the Atlas ID for this font page image

Font Size is the size value you set in your Theme to access this font page.
Make it match your Fixed Size unless you're doing something funky.

Fixed Size is the actual Glyph Size in terms of its space in the font image.

Ascent and Descent are kinda hard to understand values, they set the vertical height and distance between each new line. descent_example

Height is for Vertical fonts, just set it to match your Fixed Size if you're making a normal horizontal font.

Once you're done with your options, Run the scene that contains the node with the FontCreator script on it, and it will do its process.

godot-tileset-to-font's People

Contributors

sievaxx avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

boyquotes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.