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
LeXXik
September 30, 2020, 8:33am
#2
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:
Do you have any plans for allowing a user to write logic for the PlayCanvas designer?
For example:
Creating procedural levels that add entities directly in the Designer
Extending its functionality e.g. creating a path tool for navigation (camera, entities etc.)
Something like maxscript only you already have javascript and a scripting system in place.
Thanks for the great work!
I’ve seen that there are a couple of extension out there for the PlayCanvas Editor.
Some of them are free and some of them are payed extensions.
But where to get started when you want to write your own extension for the editor.
Is there a tutorial somewhere? @whydoidoit
So for example to change a property in an element component you can do this:
Select the entity in editor
Open the browser console
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