Пример #1
0
void TextShape::DrawSubString(ref_ptr<dp::GraphicsContext> context, StraightTextLayout & layout,
                              dp::FontDecl const & font, glm::vec2 const & baseOffset,
                              ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures,
                              bool isPrimary, bool isOptional) const
{
  glsl::vec2 const pt = glsl::ToVec2(ConvertToLocal(m_basePoint, m_params.m_tileCenter, kShapeCoordScalar));
  layout.SetBasePosition(glsl::vec4(pt, m_params.m_depth, -m_params.m_posZ), baseOffset);

  dp::Color outlineColor = isPrimary ? m_params.m_titleDecl.m_primaryTextFont.m_outlineColor
                                     : m_params.m_titleDecl.m_secondaryTextFont.m_outlineColor;

  if (outlineColor == dp::Color::Transparent())
    DrawSubStringPlain(context, layout, font, baseOffset, batcher, textures, isPrimary, isOptional);
  else
    DrawSubStringOutlined(context, layout, font, baseOffset, batcher, textures, isPrimary, isOptional);
}
Пример #2
0
void TextShape::DrawSubString(StraightTextLayout const & layout, dp::FontDecl const & font,
                              glm::vec2 const & baseOffset, ref_ptr<dp::Batcher> batcher,
                              ref_ptr<dp::TextureManager> textures,
                              bool isPrimary, bool isOptional) const
{
  dp::Color outlineColor = isPrimary ? m_params.m_primaryTextFont.m_outlineColor
                                     : m_params.m_secondaryTextFont.m_outlineColor;

  if (outlineColor == dp::Color::Transparent())
  {
    DrawSubStringPlain(layout, font, baseOffset,batcher, textures, isPrimary, isOptional);
  }
  else
  {
    DrawSubStringOutlined(layout, font, baseOffset, batcher, textures, isPrimary, isOptional);
  }
}