Code that runs in the editor?

Hi

I’m curious if there is any methods similar to the initialize and update methods, but that runs in the editor allready? I’d like to change some text boxes in the UI system so the background lines up with lenght of the text, but I’d like to see the result allready when in editor just for faster feedback loops.

Regards

  • Björn

This is not possible at the moment.

Edit: I mean without creating a custom extension for the Editor.

Hi @bjorn.syse,

There isn’t an official editor API to use, but you can relatively easily execute code in editor using the browser console.

Here are some helpful posts to get you started:

So for example to change a property in an element component you can do this:

  1. Select the entity in editor
  2. Open the browser console
  3. Run this code to update the Text property:
editor.call('entities:selectedFirst').set('components.element.text', 'New text!')
2 Likes

Ok, thanks. I’ll keep myself updated on that.

Would be good to be able to control parts of entities programmatrically.

1 Like