|
|
"jr" <cre### [at] gmailcom> wrote:
> not sure about objects in general, but with a text{} you could "cheat" using a
> macro, eg:
>
> #macro textLen(font_,s_)
> #local t_ = text {ttf font_, s_, 1, 0};
> (max_extent(t_).x - min_extent(t_).x)
> #end
>
> #declare txt_ = text {
> ttf "timrom.ttf", "some more text", .1, 0
> texture {texture_}
> translate <-(textLen("timrom.ttf","some more text")) / 2,-2,0>
> };
> object {txt_}
>
>
> regards, jr.
Your solution works like a charm. My problem was exactly the text. It is easier
to find the middle point for an object as we design them, but for texts, we rely
on font metrics.
Thanks!
Post a reply to this message
|
|