Show
Ignore:
Timestamp:
08/10/06 14:13:02 (8 years ago)
Author:
robert
Message:

From Martijn Kragtwijk, added example text for showing osgText::Text::CharacterSizeMode? in action.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgtext/osgtext.cpp

    r5395 r5415  
    418418    text4->setAxisAlignment(osgText::Text::SCREEN); 
    419419 
     420    osg::Vec4 characterSizeModeColor(1.0f,0.0f,0.5f,1.0f); 
     421 
     422    osgText::Text* text5 = new osgText::Text; 
     423    text5->setColor(characterSizeModeColor); 
     424    text5->setFont("fonts/times.ttf"); 
     425    //text5->setCharacterSize(characterSize); 
     426    text5->setCharacterSize(32.0f); // medium 
     427    text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2)); 
     428    text5->setAxisAlignment(osgText::Text::SCREEN); 
     429    text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS); 
     430    text5->setText("CharacterSizeMode SCREEN_COORDS(size 32.0)"); 
     431    geode->addDrawable(text5); 
     432 
     433    osgText::Text* text6 = new osgText::Text; 
     434    text6->setColor(characterSizeModeColor); 
     435    text6->setFont("fonts/times.ttf"); 
     436    text6->setCharacterSize(characterSize); 
     437    text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4)); 
     438    text6->setAxisAlignment(osgText::Text::SCREEN); 
     439    text6->setCharacterSizeMode(osgText::Text::OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT); 
     440    text6->setText("CharacterSizeMode OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT"); 
     441    geode->addDrawable(text6); 
     442 
     443    osgText::Text* text7 = new osgText::Text; 
     444    text7->setColor(characterSizeModeColor); 
     445    text7->setFont("fonts/times.ttf"); 
     446    text7->setCharacterSize(characterSize); 
     447    text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6)); 
     448    text7->setAxisAlignment(osgText::Text::SCREEN); 
     449    text7->setCharacterSizeMode(osgText::Text::OBJECT_COORDS); 
     450    text7->setText("CharacterSizeMode OBJECT_COORDS (default)"); 
     451    geode->addDrawable(text7); 
     452 
    420453#if 1 
    421454    // reproduce outline bounding box compute problem with backdrop on.