| 68 | } |
| 69 | |
| 70 | void CenterState::draw() |
| 71 | { |
| 72 | for( list<Circle>::iterator circleIt = mCircles.begin(); circleIt != mCircles.end(); ++circleIt ){ |
| 73 | circleIt->draw( app::getWindowCenter() ); |
| 74 | } |
| 75 | |
| 76 | float radius = 140.0f; |
| 77 | |
| 78 | // draw string |
| 79 | // biggest square that can fit in the circle is radius * sqrt(2) per side x^2 = (r^2)/2 |
| 80 | const float squareSide = sqrtf( ( radius * radius ) / 2.0f ); |
| 81 | |
| 82 | float pixelScale = std::min( squareSide / mWordPixelLength, squareSide / 140 ) * 2.0f; |
| 83 | gl::TextureFont::DrawOptions options = gl::TextureFont::DrawOptions().scale( pixelScale ).pixelSnap( false ); |
| 84 | |
| 85 | const vec2 offset = vec2( -radius + ( radius * 2 - mWordPixelLength * pixelScale ) / 2, radius - (radius * 2.0f - 60 * pixelScale ) / 2 ); |
| 86 | |
| 87 | gl::color( ColorA( Color::black(), mTextAlpha * 0.5f ) ); |
| 88 | sFont->drawString( mWord, mTextPos() + offset + vec2( pixelScale, pixelScale ) * 1.5f, options ); |
| 89 | |
| 90 | gl::color( ColorA( Color::white(), mTextAlpha ) ); |
| 91 | sFont->drawString( mWord, mTextPos() + offset, options ); |
| 92 | } |
| 93 | |
| 94 | void CenterState::setFont( gl::TextureFontRef font ) |
| 95 | { |
nothing calls this directly
no test coverage detected