public GuiSceneNode(int width, int height, GuiModule module) { this.module = module; uiCamera = new OrthographicCamera(new Viewport(0,0, width, height)); uiRoot = new UIItem(new Rectangle(0,0,width,height)); uiRoot.defaults = module.defaultSettings; uiRoot.settings = new MISP.GenericScriptObject(); uiCamera.focus = new Vector2(width / 2, height / 2); }
public RenderContext2D(GraphicsDevice device) { this.GraphicsDevice = device; //Effect = new AlphaTestEffect(device); Effect = new BasicEffect(device); Camera = new OrthographicCamera(device.Viewport); MatrixStack = new MatrixStack(); Black = new Texture2D(device, 1, 1, false, SurfaceFormat.Color); Black.SetData(new Color[] { new Color(0, 0, 0, 255) }); White = new Texture2D(device, 1, 1, false, SurfaceFormat.Color); White.SetData(new Color[] { new Color(255, 255, 255, 255) }); //Effect.ReferenceAlpha = 32; Effect.TextureEnabled = true; }
public void DrawRoot(UIItem root, OrthographicCamera camera, RenderTarget2D target) { uiRenderer.Camera = camera; uiRenderer.BeginScene(target); root.Render(uiRenderer); }