Sorry, I was wanting to send it to the list as well.
Olivier.
-------- Message original --------
Sujet: Re: [Agar] Centering elements
Date : Thu, 25 Nov 2010 23:34:04 +0100
De : Olivier Boudeville <[email protected]>
Pour : Julien Nadeau <[email protected]>
Hi Julien,
Thanks for your answer, it works good for labels. Is there a way to do
the same for images as well? Centering and right-aligning would be quite
convenient.
On an unrelated note, is there any other way than using
AG_SetDefaultFont to set the font to be used for a label? Should not
there be a font associated to a label?
Regarding HTML links:
- http://libagar.org/mdoc.cgi?man=AG_Font.3 is a dead link (ex:
referenced in http://libagar.org/mdoc.cgi?man=AG_FontSelector.3)
- same thing for http://libagar.org/mdoc.cgi?man=printf.3 (from
http://libagar.org/mdoc.cgi?man=AG_Label.3)
- a link to 'font' from 'label' could be interesting
Thanks again for this library,
Best regards,
Olivier Boudeville.
Le 24/11/2010 05:05, Julien Nadeau a écrit :
On Tue, Nov 23, 2010 at 10:24:28PM +0100, Olivier Boudeville wrote:
Hi,
I would like to display a label centered in its container: is there any
built-in way to do that? I was also thinking to computing and assigning
directly its coordinates to have it at the center (thus bypassing the
actual packing system), or to use empty left/right and top/bottom
elements so that a pane would pack it by design at the center, but both
solutions seem a bit awkward?
This should do the trick:
AG_Label *label;
label = AG_LabelNew(parent, AG_LABEL_HFILL, "foo");
AG_LabelJustify(label, AG_TEXT_CENTER);
By the way in http://libagar.org/mdoc.cgi?man=AG_Fixed.3a demos/gamemenu
demo is mentioned but does not seem to exist (at least not on the 1.4...0
version from SVN).
Fixed, thanks. "fixedres" is the correct one.
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html