Skip to content
Lulezer edited this page Nov 5, 2025 · 3 revisions

Drawing text is very simple. here is how to write text in echlib.

first you will need a font which you can get from the internet for free.

then before the While loop you must add this line of code cpp "" ech::Font font("PathOfFont.ttf", SizeOfFont); ""

then when you wanna draw the text you must add cpp "" font.Draw("text", posX, PosY, ech::Color); ""

and thats it.

example:

#include <echlib.hpp>


int main() {

	ech::CreateWindow(800, 600, "Echlib Test");
	ech::SetFpsLimit(60);

	ech::Font font(RESOURCES_PATH"123.ttf", 32.0f);



	while (!ech::WindowShouldClose())
	{
		ech::StartDrawing();

		ech::ClearBackground(ech::GRAY);

		font.Draw("Hello, Echlib!", 00.0f, 280.0f, ech::RED);


		ech::EndDrawing();
	}
	ech::CloseWindow();
	ech::ApplyFpsLimit(ech::GetDeltaTime());
	return 0;
}

Yo

Clone this wiki locally