Hi, everyone, I hope to use DOM as the basic UI interface and webgl as the game canvas rendering, but when I adjust the webgl canvas, the rendering size is not adjusted correctly. Is that what I’ve missed?
Two Lime.embed:
<script type="text/javascript">
lime.embed ("ZIde", "content", 0, 0);
</script>
<script type="text/javascript" src="./game/HxwzHaxe.js"></script>
<script type="text/javascript">
lime.embed ("HxwzHaxe", window.canvas, 800, 480);
</script>
Resize webgl canvas:
public function onWindowResize():Void {
trace("bitmapData",bitmapData.width,bitmapData.height);
@:privateAccess bitmapData.__resize(Std.int(this.width), Std.int(this.height));
var stage:Stage = untyped window.uiContext;
stage.window.resize(Std.int(this.width),Std.int(this.height));
@:privateAccess stage.__resize();
// trace(stage.context3D.backBufferWidth,stage.context3D.backBufferHeight);
}