You can vote this suggestion
https://construct3.ideas.aha.io/ideas/C3-I-1705
Wow, Amazing!
mOOnpunk You're right, this would be amazing
RASHID_AB You can do this:
c3p
github
Demo online
You can do something like this with mesh and mask
Playing with mesh distortion
https://www.patreon.com/posts/mesh-shapes-47493518
https://c3demo.stranianelli.com/javascript/009-mesh-and-shapes/demo/
You can use IWorldInstance.setMeshPoint(col, row, opts) to set mesh point position. But what if I want get the point position?
I want do something like this:
PSEUDOCODE:
function lerpMeshPointPosition(instance, t, { col, row, newX, newY } = {}) { const startX = instance.getMeshPoint(col, row, "absolute").x; const startY = instance.getMeshPoint(col, row, "absolute").y; const lerpedX = lerp(startX, newX, t); const lerpedY = lerp(startY, newY , t); instance.setMeshPoint(col, row, {mode: "absolute", x: lerpedX , y: lerpedY }); }
Did you intend in js?
const myArray = ["Zero", "One"]; const index = 0; console.log(myArray[index]);
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Instead if you intend the plugin array see https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/array
const myArray = runtime.objects.array.getFirstInstance(); console.log(myArray.getAt(0));
Develop games in your browser. Powerful, performant & highly capable.
huras
You can use something like this
runOnStartup(async runtime => { globalThis.publicRuntime = runtime; });
Use this
export function printTextToOutput() { const instance=g_runtime.objects.textOutput.getFirstInstance(); instance.text = text; }
and in main.js
runOnStartup(async runtime => { globalThis.g_runtime = runtime; });
See this https://www.patreon.com/posts/construct-3-46901116 for the g_runtime
(O qui, in italiano https://blog.stranianelli.com/new-template-construct-3-youtube/)
You can declare this also in print.js
You can do something like this (I'm writing from my smartphone, I can't test this code now)
export function printTextToOutput() { const instance=runtime.objects.textOutput.getFirstInstance(); instance.text = text; }
And in the event sheet call Printer.printTextToOutput() when textOutput is created
You can check this https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iobjectclass
È Martin Mystere quello nel tuo avatar?
What do you mean with "only js"? Without event sheets?
Have you seen the event sheet "printer"?
If you want, you can check the Ghost Shooter Template
Try this links
https://github.com/el3um4s/construct-demo/tree/master/mini-template/001-execute-a-function-from-separate-event-sheet
Member since 9 Nov, 2015