#include "font.h" #include "../japi/game.h" namespace font { static draw::surface *font1 = nullptr; static draw::surface *font2 = nullptr; static int mode = font::type::normal; void init() { font::font1 = draw::loadSurface("fuente1.gif"); font::font2 = draw::loadSurface("fuente2.gif"); } void selectFont(const int which) { font::mode = which; } void setColor(const int color) { switch (color) { case font::color::white: draw::setPaletteEntry(63, 255, 255, 255); break; case font::color::red: draw::setPaletteEntry(63, 255, 0, 0); break; case font::color::green: draw::setPaletteEntry(63, 0, 255, 0); break; case font::color::blue: draw::setPaletteEntry(63, 0, 0, 255); break; } } void print(const int x, const int y, const std::string text) { draw::setSource(font::mode == font::type::colored ? font::font2 : font::font1); if (font::mode == font::type::fade) for (int i=64;i<=67;++i) draw::swapcol(i, i+4); const int len = text.length(); for (int i=0;i