34 lines
777 B
C++
34 lines
777 B
C++
#include "Color.hpp"
|
|
#include "raylib.h"
|
|
#include <raylib-cpp.hpp>
|
|
|
|
int main() {
|
|
raylib::Window window(800, 600, "AS0");
|
|
window.SetState(FLAG_WINDOW_RESIZABLE);
|
|
|
|
while (!window.ShouldClose()) {
|
|
raylib::Text text;
|
|
int fontHeight = 20;
|
|
text.SetText("Hello World");
|
|
text.SetFontSize(fontHeight);
|
|
text.SetSpacing(2);
|
|
text.SetColor(raylib::Color::Gray());
|
|
|
|
window.BeginDrawing();
|
|
|
|
window.ClearBackground(raylib::Color::RayWhite());
|
|
|
|
int width = window.GetWidth();
|
|
int height = window.GetHeight();
|
|
|
|
int middleX = (width - text.Measure()) / 2;
|
|
int middleY = (height - fontHeight) / 2;
|
|
|
|
text.Draw(middleX, middleY);
|
|
|
|
window.EndDrawing();
|
|
}
|
|
|
|
return 0;
|
|
}
|