[vtkusers] vtktextactor doesn't move

David Lonie david.lonie at kitware.com
Tue Feb 11 08:57:25 EST 2014


Hey Doug,

On Mon, Feb 10, 2014 at 4:24 PM, Doug Hoppes <dhoppes at mbfbioscience.com>wrote:

>  Hi all,
>
>
>
>                 I'm trying to use a vtkTextActor to show some text on my
> screen.  I have a single viewport showing.  When I change the position of
> the text actor, it is always on the bottom left of the screen (I'm assuming
> that this is 0,0).
>
>
>
> Code:
>
> vtkSmartPointer<vtkTextActor> m_pLabelActor = vtkSmartPointer<vtkTextActor
> >::New();
>
>       m_pLabelActor->GetTextProperty()->SetFontSize(40);
>
>       m_pLabelActor->SetPosition2(50,50);
>

Try

m_pLabelActor->SetPosition(50, 50);

(not SetPosition2). SetPosition2 is used to specify the other corner of a
rectangle when rendering to a specific size. It is a bit confusing, since
this is the convention we use to specify vector length in setters/getters...

Hope this helps,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140211/008fcd33/attachment.html>


More information about the vtkusers mailing list