|
#include "stdafx.h"
#include "Text2DTool.h"
#include <OAGFontMapping2D.h>
CText2DTool::CText2DTool(void)
{
}
CText2DTool::~CText2DTool(void)
{
}
void CText2DTool::AddAllVerticesToScene()
{
oag::OAGFontMapping2D* font2d = new oag::OAGFontMapping2D();
if( m_pScene->GetFontMappingTable()->m_ListFont.size() > 0 )
{
font2d->SetFont( m_pScene->GetFontMappingTable()->m_ListFont[0]->GetFont() );
font2d->SetFontNameReference ( m_pScene->GetFontMappingTable()->m_ListFont[0]->GetFontName() );
}
oag::OAGVector3f vec = m_arrVector[0];
font2d->SetText("Example of 2DText");
font2d->SetPosition( oag::OAGVector3f( vec.m_X, vec.m_Y, vec.m_Z ) );
m_pScene->AddObject( font2d );
}
void CText2DTool::OnMouseClick(oag::OAGVector3f& ptMouse)
{
switch( m_nStep )
{
case 0:
{
m_arrVector.Add( ptMouse );
AddAllVerticesToScene();
CTool::OnFinalize();
}
break;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I live in Matão, a small city in Brazil. I studied as Programmer in a College for Software Development in Database.
After finishing the College I have been working with java, c# and Computer Graphics with searches for OpenGL.