#include <stdint.h>
#include "Images/digi18x32.h"
#include "monoimg.h"
#include "st7735.h"

void ui_text_number18x32(uint32_t num, uint16_t x, uint16_t y, uint16_t color) {
    uint32_t tmp = num;
    uint32_t div = 1;
    uint8_t num_count = 0;
    while (tmp > 0) {
        tmp = tmp / 10;
        num_count ++;
        div = div * 10;
    }
    div = div / 10;
    while (div > 0) {
        tmp = (num / div) % 10;
        mimg_Area area = mimg_get_tile_area(IMG_DIGI_18_32, 10, 1, tmp);
        mimg_draw(ST7735_DrawPixel, x, y, color, IMG_DIGI_18_32, area);
        x = x + 18;
        div = div / 10;
    }
}

// TODO: 绘制文字的方法
