// text fit test
Property::Map backgroundMap;
backgroundMap["color"] = Color::RED;
backgroundMap["enable"] = true;
Property::Map textFitMap;
textFitMap["enable"] = true;
textFitMap["minSize"] = 10.f;
textFitMap["maxSize"] = 60.f;
textFitMap["stepSize"] = 4.f;
textFitMap["fontSizeType"] = "pointSize";
width = 700;
height = 100;
textFit = TextLabel::New( "Long enough message for TextLabel!! This is a Text Fit sample text " );
textFit.SetSize( width, height );
textFit.SetParentOrigin(ParentOrigin::TOP_LEFT);
textFit.SetAnchorPoint(AnchorPoint::TOP_LEFT);
textFit.SetPosition( 100.f, 300.f);
textFit.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMap );
textFit.SetProperty( Toolkit::DevelTextLabel::Property::BACKGROUND, backgroundMap );
stage.Add( textFit );
stage.KeyEventSignal().Connect( this, &HelloWorldController::OnKeyEvent );
}
void OnKeyEvent( const KeyEvent& event )
{
if( event.state == KeyEvent::Down )
{
width -= 40;
textFit.SetSize( width, height );
}
}
Change-Id: Ie7f3cd5cc5e0fa581f8e4912ccb5e88049499f31