Temporalin
New Member
Hi there, first time posting.
I've been working with StreamControl using HTML files to make some fancy layouts. It was working until I tried to automatically adjust an image. To do that I made this:
This works as intended in Firefox but not with the OBS Browser. I used alert(mic.image) to check if it was the same and both browsers return object HTMLImageElement. The difference appears when accessing attributes: alert(mic.image.width) returns the size in Firefox but 0 in OBS
What do I do? I know I could manually resize the image and avoid the need of accessing the attributes, but then this would remain unsolved and may be useful for other things or people
Thanks
I've been working with StreamControl using HTML files to make some fancy layouts. It was working until I tried to automatically adjust an image. To do that I made this:
HTML:
mic = new createjs.Bitmap("images/mic.png");
micScaleX = 22 / mic.image.width;
micScaleY = 22 / mic.image.height;
mic.setTransform(x = 732, y = 720 - mic.image.height * micScaleY, scaleX = micScaleX, scaleY = micScaleY);
board.addChild(mic);
This works as intended in Firefox but not with the OBS Browser. I used alert(mic.image) to check if it was the same and both browsers return object HTMLImageElement. The difference appears when accessing attributes: alert(mic.image.width) returns the size in Firefox but 0 in OBS
What do I do? I know I could manually resize the image and avoid the need of accessing the attributes, but then this would remain unsolved and may be useful for other things or people
Thanks