Hello everyone,
I have a text object name "A" and I want to change color of it using Javascript (instead of action). I tried to code like this but it's not works. I don't know that I made something wrong or not or maybe Construct hasn't support this feature yet.
let textA = null;
runOnStartup(async runtime =>
{
// Code to run on the loading screen.
// Note layouts, objects etc. are not yet available.
runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
});
async function OnBeforeProjectStart(runtime)
{
// Code to run just before 'On start of layout' on
// the first layout. Loading has finished and initial
// instances are created and available to use here.
textA = runtime.objects.A.getFirstInstance();
runtime.addEventListener("tick", () => Tick(runtime));
}
function Tick(runtime)
{
// Code to run every tick
textA.colorRgb = (255, 0, 0);
}