Jump to content

Load programmatically created Object


photo

Recommended Posts

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
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

 

  • Like 1
  • Thanks 1
Link to comment
×
×
  • Create New...