41 lines
917 B
C++
41 lines
917 B
C++
//
|
|
// Created by my on 2019/11/16.
|
|
//
|
|
|
|
#ifndef TEXTRENDERER_TEXTRENDERER_H
|
|
#define TEXTRENDERER_TEXTRENDERER_H
|
|
|
|
#include "Font.h"
|
|
#include <Color.hpp>
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <vkvm.hpp>
|
|
|
|
/**
|
|
* @author: Yajie Qi, Shaohua Tong
|
|
* @since: v0.0.0
|
|
* @brief: gets a string from the Shared Memory and converts the text into a bitmap-array.
|
|
*/
|
|
class TextRenderer {
|
|
public:
|
|
TextRenderer();
|
|
|
|
void update(std::string text);
|
|
void setOldText(std::string text);
|
|
std::vector<std::vector<bool>> getCharacter(unsigned char character);
|
|
void setLeftMargin(int margin);
|
|
void setBottomMargin(int margin);
|
|
void clear();
|
|
|
|
private:
|
|
std::string oldText;
|
|
int left_margin = 1;
|
|
int bottom_margin = 1;
|
|
int type;
|
|
Font font;
|
|
void translateToSharedMemory(std::vector<std::vector<bool>> characterBitmap, int startX, int startY);
|
|
};
|
|
|
|
|
|
#endif //TEXTRENDERER_TEXTRENDERER_H
|