Bases of Elements

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Bases of Elements

Post by mike »

Green_Hell wrote:2. Count height of whole text line (Font:getHeight( )? Who knows.)
Font:getHeight()
Green_Hell wrote:Isn't solution. Still draws somewhere. I can't explain what I need. :(
You want there to be a function that sets an area (a rectangle) for drawing text so that text aligns itself within that box and aligns accordingly?

Also, do you people want Font:setCenter(love.align_center) This would mean that text would be drawn with the center being the center of the text.
Now posting IN STEREO (where available)
Green_Hell
Citizen
Posts: 94
Joined: Thu Feb 21, 2008 1:11 am

Re: Bases of Elements

Post by Green_Hell »

textometry.png
textometry.png (4.07 KiB) Viewed 2983 times
I need to be able to draw text somewhere and know where are the last pixels of the drawn line on all 4 sides.

Sizes I need and I think I have them are in Fuchsia. Not sure about Height.
Size, which I need, to be able to set base wherever I want is Lime Green.
c1, c2, c3, c4 are corners of the envelope.
You c2 is actually diferent to the current base which is only corner I know where it is but, don't know where is in relation to the envelope.

Screw these colors! :x
>>I love LÖVE.<<
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Bases of Elements

Post by mike »

Aha, I see what you need now. Love the nice little picture.

But I have no idea how to do this, especially with the current system. I'll add Font:getEnvelope() (or something) to the task list, but I'm not promising anything, as this looks horribly confusing. This may be a stupid question, but why do you need this?
Now posting IN STEREO (where available)
Green_Hell
Citizen
Posts: 94
Joined: Thu Feb 21, 2008 1:11 am

Re: Bases of Elements

Post by Green_Hell »

mike wrote:This may be a stupid question, but why do you need this?
As usual. I'm trying to do something what LÖVE isn't designed for. :roll:

The problem is that I can't do it in a different language or a tool-kit. I'll probably write a specification and post it here on the forum hoping that somebody else will do it. I was planing to do this but wanted to have something finished to provide. :cry:
>>I love LÖVE.<<
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Bases of Elements

Post by rude »

mike wrote:But I have no idea how to do this, especially with the current system. I'll add Font:getEnvelope() (or something) to the task list, but I'm not promising anything, as this looks horribly confusing. This may be a stupid question, but why do you need this?
FreeType provides access to all font metrics. http://www.freetype.org/freetype2/docs/ ... step2.html
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Bases of Elements

Post by qubodup »

Green_Hell wrote:
textometry.png
I want to officially thank you in the name of world for using visualization of what'cha talking 'boot.

Thank you! Thumbs up!
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Bases of Elements

Post by mike »

rude wrote:
mike wrote:But I have no idea how to do this, especially with the current system. I'll add Font:getEnvelope() (or something) to the task list, but I'm not promising anything, as this looks horribly confusing. This may be a stupid question, but why do you need this?
FreeType provides access to all font metrics. http://www.freetype.org/freetype2/docs/ ... step2.html
Touché. I may be laying this task on you, then.. since you actually fucking read the documentation..
Now posting IN STEREO (where available)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 38 guests