Blame demo/src/font.c

b9c036
b9c036
#include <math.h></math.h>
b9c036
b9c036
#include <helianthus.h></helianthus.h>
b9c036
b9c036
#include "font.h"
b9c036
b9c036
b9c036
28a314
static Font font;
b9c036
b9c036
b9c036
void fontInit() {
b9c036
	font = createFont("data/fonts/blackcry.ttf");
b9c036
}
b9c036
b9c036
b9c036
void fontDraw() {
deef1d
	saveState();
3954ba
	
b9c036
	double x = 512;
b9c036
	double y = 256;
b9c036
	
d4e89f
	fill(colorByName("1 0 0 0.5"));
b9c036
	textSize(64*(1+sin(worldGetSeconds()/4)));
b9c036
	text("Here is the\nleft aligned\ntext. VAW.", x, y);
b9c036
	
da4619
	noFill();
b9c036
	textFont(font);
b9c036
	textAlign(HALIGN_RIGHT, VALIGN_TOP);
b9c036
	text("Here is the\nright aligned\ntext. VAW.", x, y);
b9c036
	
deef1d
	restoreState();
b9c036
}
b9c036
b9c036