Antoine.YVAN Posted December 16, 2021 Share Posted December 16, 2021 Hello ! I am currently working on an Editor plugin on 2.14.1.1. What I want to do : - Programmatically create an ObjectText - Give it a position, font size, text message - Load it into the world - Manipulate it inside the Editor I want it to work on any project so I cannot create a node reference. I can't seem to find a way to load it into the world without previously creating a node reference. Is what I want possible ? Am I missing something ? Or maybe there is a default node reference for object texts that I can load and then cast into an ObjectText ? Thanks for your time. Antoine Link to comment
cash-metall Posted December 17, 2021 Share Posted December 17, 2021 13 hours ago, Antoine.YVAN said: I want it to work on any project so I cannot create a node reference. I can't seem to find a way to load it into the world without previously creating a node reference. Hello! you can create ObjectText manualy with ObjectTextPtr text = ObjectText::create(font_name, text); // create your own ObjectText text->setWorldPosition(any_pos); // set to position text->setLifetime(Node::LIFETIME_ENGINE); // to make this object independent on world lifetime text->setShowInEditorEnabled(true); // enable show in world hierarhy 1 1 Link to comment
Antoine.YVAN Posted December 17, 2021 Author Share Posted December 17, 2021 This method here : setShowInEditorEnabled(true); is exactly what I was looking for. Thanks ! 1 Link to comment
Recommended Posts