O'Reilly logo

Libgdx Cross-platform Game Development Cookbook by Alberto Cejas Sánchez, David Saltares Márquez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Font Rendering

In this chapter, we will cover the following recipes:

  • Generating and rendering bitmap fonts
  • Baking effects into fonts using Hiero
  • Scaling friendly font rendering with distance fields
  • Dynamic font effects using distance fields

Introduction

Depending on the genre of your awesome game project, you may need to show the user more or less text. Role-playing games and some adventures tend to be very text-heavy, while action games … well, they let the guns do the talking. However, in all likeness, all of these will require some font rendering, even if it is just for the menus or the game scores.

This chapter will start with the very basics of how to generate a Libgdx-compatible font and render some text with it on the screen. We will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required