I need some help, obviously I’m doing something wrong/need more code that I don’t know what it is. I really need this to work using Javascript.
Let’s say I have a 3D Box that has a “front” face that is 100 x 100, and I have an image that is 250 x 250.
If I use the GDevelop command “Change the image of ‘front’ face of [box] to [image]”, the image is automatically resized and shows up on the box face.
However, if I use the Javascript commands:
/** @type {gdjs.Cube3DRuntimeObject} */
const thebox1 = runtimeScene.getObjects(“box”);
thebox1[0].setFaceResourceName(“front”, “image.png”);
then the image does not resize, it does not show up on the box, and I’m left with the purple broken image on my box face.
That Javascript code DOES work if the image is smaller than the box face.
Any idea what I can do to get the image to automatically resize using Javascript??