Multiple window questions

Trying to build something with two windows.

	Lib.application.window.x = 50;
	Lib.application.window.y = 50;
	
	var window2 = new Window();
	Lib.application.createWindow(window2);
	var rendr2 = new Renderer(window2);
	window2.application.addRenderer(rendr2);
	
	window2.application.config.name = "teste";
	window2.width = 960;
	window2.height = 1620;
	window2.x = 1200;
	window2.y = 50;
	window2.stage.color = 0xeeeeee;
  • second window throws a Null Object Reference if I try to stage.color it. If I remove .color it draws the window and continues execution.

  • second window doesn’t assume .name for some reason

  • is it possible to use a second window as an away3d viewport ?

Edit: tried window2.config.background = 0x0000ee; but same error gets thrown.

Substituting lime.ui.Window with openfl.display.Window fixes the color part of it.

The name thing works like this for the initial window:

	Lib.application.window.title = "Something";

and like this for the second window:

	window2.title = "Other";

So, can the second window be used as some sort of away3d viewport and have both windows display different views from the same away3d scene ?

Maybe something like:

var window2 = new Window();
window2.application.config.name = "test";
window2.width = 960;
window2.height = 1620;
window2.x = 1200;
window2.y = 50;
window2.stage.color = 0xeeeeee;

stage.application.createWindow (window2);

Each window has its own stage, I have not personally tested Stage3D across multiple windows, in principle it should work, but Away3D would have to be aware of multiple Stage3D instances off different stages in order for it to work properly. I’m not sure if it handles that currently

1 Like