示例#1
0
文件: text.cpp 项目: dchar/SD_Engine
Text::Text() {
	this->font = nullptr;
	this->string_msg_ptr = nullptr;
	this->position_ptr = nullptr;
	this->offset = VectorXY(0, 0);
	this->max_width = 0;
	this->line_height = 0;
}
示例#2
0
文件: text.cpp 项目: dchar/SD_Engine
void Text::Initialize(ALLEGRO_FONT *font, string *msg, VectorXY *position) {
	this->font = font;
	this->string_msg_ptr = msg;
	this->position_ptr = position;
	this->offset = VectorXY(0, 0);
	this->max_width = 1000;
	this->line_height = 15;

	al_draw_multiline_text(this->font, al_map_rgb(255, 255, 255), (*this->position_ptr).x,
		(*this->position_ptr).y, this->max_width, this->line_height, 0, (*this->string_msg_ptr).c_str());
}
示例#3
0
Vector2D Vector(Point2D A, Point2D B) {
    return VectorXY(B.x - A.x, B.y - A.y);
}