Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

How to print text with QText2DEntity?

  • There was this question already:
    Re: Qt3D: how to print text? (QText2DEntity)
    And, as an only working example of usage, was this code:

    // camera position
    auto *camera = _view->camera();
    camera->setPosition({ 0, 40.0f, 0 });
    camera->setViewCenter({ 0, 0, 0 });
    camera->setUpVector({ 0, 0, 1.0f });
    // text
    auto *text2D = new Qt3DExtras::QText2DEntity(_rootEntity);
    auto *textTransform = new Qt3DCore::QTransform(text2D);
    textTransform->setRotation(QQuaternion::fromAxisAndAngle({ 1, 0, 0 }, 90.0f));

    But, it's not working for me: just nothing appears. Code looks correct, so, probably, the question is about correct parameters: width, height and scale for text. I've tried but didn't reach any result.

    Does anyone have any working example of this class usage?

  • Hi,

    do you have already a solution? Doesn't work for me neither.

  • @Cute3d, yes, it finally works. Idk what was wrong. Example project:
    And due to god-knows-what reasons it doesn't work in debug mode. Hope, that project can help someone.

  • Banned

    This post is deleted!