mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fixed font origin
This commit is contained in:
@@ -46,7 +46,7 @@ namespace opengl
|
|||||||
void ImageFont::print(string text, float x, float y) const
|
void ImageFont::print(string text, float x, float y) const
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(x, y, 0.0f);
|
glTranslatef(x, y+getHeight(), 0.0f);
|
||||||
GLuint OpenGLFont = list;
|
GLuint OpenGLFont = list;
|
||||||
glListBase(OpenGLFont);
|
glListBase(OpenGLFont);
|
||||||
glCallLists((int)text.length(), GL_UNSIGNED_BYTE, text.c_str());
|
glCallLists((int)text.length(), GL_UNSIGNED_BYTE, text.c_str());
|
||||||
@@ -57,7 +57,7 @@ namespace opengl
|
|||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
glTranslatef(x, y, 0.0f);
|
glTranslatef(x, y+getHeight(), 0.0f);
|
||||||
glRotatef(angle * 57.29578f, 0, 0, 1.0f);
|
glRotatef(angle * 57.29578f, 0, 0, 1.0f);
|
||||||
glScalef(sx, sy, 1.0f);
|
glScalef(sx, sy, 1.0f);
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ namespace opengl
|
|||||||
void ImageFont::print(char character, float x, float y) const
|
void ImageFont::print(char character, float x, float y) const
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(x, y, 0.0f);
|
glTranslatef(x, y+getHeight(), 0.0f);
|
||||||
GLuint OpenGLFont = list;
|
GLuint OpenGLFont = list;
|
||||||
glListBase(OpenGLFont);
|
glListBase(OpenGLFont);
|
||||||
glCallList(list + (int)character);
|
glCallList(list + (int)character);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ namespace opengl
|
|||||||
void TrueTypeFont::print(string text, float x, float y) const
|
void TrueTypeFont::print(string text, float x, float y) const
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(ceil(x), ceil(y), 0.0f); // + getHeight() to make the x,y coordiantes the top left corner
|
glTranslatef(ceil(x), ceil(y+getHeight()), 0.0f); // + getHeight() to make the x,y coordiantes the top left corner
|
||||||
GLuint TrueTypeFont = list;
|
GLuint TrueTypeFont = list;
|
||||||
glListBase(TrueTypeFont);
|
glListBase(TrueTypeFont);
|
||||||
glCallLists((int)text.length(), GL_UNSIGNED_BYTE, text.c_str());
|
glCallLists((int)text.length(), GL_UNSIGNED_BYTE, text.c_str());
|
||||||
@@ -158,7 +158,7 @@ namespace opengl
|
|||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
glTranslatef(ceil(x), ceil(y), 0.0f);
|
glTranslatef(ceil(x), ceil(y+getHeight()), 0.0f);
|
||||||
glRotatef(angle * 57.29578f, 0, 0, 1.0f);
|
glRotatef(angle * 57.29578f, 0, 0, 1.0f);
|
||||||
glScalef(sx, sy, 1.0f);
|
glScalef(sx, sy, 1.0f);
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ namespace opengl
|
|||||||
void TrueTypeFont::print(char character, float x, float y) const
|
void TrueTypeFont::print(char character, float x, float y) const
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(ceil(x), ceil(y), 0.0f);
|
glTranslatef(ceil(x), ceil(y+getHeight()), 0.0f);
|
||||||
GLuint TrueTypeFont = list;
|
GLuint TrueTypeFont = list;
|
||||||
glListBase(TrueTypeFont);
|
glListBase(TrueTypeFont);
|
||||||
glCallList(list + (int)character);
|
glCallList(list + (int)character);
|
||||||
|
|||||||
Reference in New Issue
Block a user