void slideshow::draw_picture_name() { std::string name = m_file_list->get(m_image_index); #ifdef WIN32 // show backslashes to the luser on Winblows std::replace(name.begin(), name.end(), '/', '\\'); #endif draw_shadow_text(*m_font, name, 1, m_options->height - 16, 224, 224, 224); }
void draw_hand_label(sf::RenderWindow& window, const float radius, const float x, const float y, const astra::HandPoint& handPoint) { const auto trackingId = handPoint.tracking_id(); std::stringstream str; str << trackingId; if (handPoint.status() == HAND_STATUS_LOST) { str << "Lost"; } sf::Text label(str.str(), font_); const int characterSize = 60; label.setCharacterSize(characterSize); const auto bounds = label.getLocalBounds(); label.setOrigin(bounds.left + bounds.width / 2.f, characterSize); draw_shadow_text(window, label, sf::Color::White, x, y - radius - 10); }
void draw_hand_position(sf::RenderWindow& window, const float radius, const float x, const float y, const astra::HandPoint& handPoint) { const auto worldPosition = handPoint.world_position(); std::stringstream str; str << std::fixed << std::setprecision(0) << worldPosition.x << ", " << worldPosition.y << ", " << worldPosition.z; sf::Text label(str.str(), font_); const int characterSize = 60; label.setCharacterSize(characterSize); const auto bounds = label.getLocalBounds(); label.setOrigin(bounds.left + bounds.width / 2.f, 0); draw_shadow_text(window, label, sf::Color::White, x, y + radius + 10); }
void slideshow::draw_picture_number() { char pcount_buf[64]; sprintf(pcount_buf, "%d/%d", m_image_index + 1, m_file_list->count()); draw_shadow_text(*m_font, pcount_buf, m_options->width - strlen(pcount_buf) * m_font->getcw() - 1, m_options->height - 16, 224, 224, 224); }