Using Empty Keys in Xenko 2.0
Last Post 23 May 2017 06:06 PM by Filip Dušek. 1 Replies.
Printer Friendly
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Levi GrahamUser is Offline
New Member
New Member

23 May 2017 02:46 AM
    I have spent some time getting all the project solutions setup properly but now I'm running into problems. I can't get anything to render. The commented out code either causes crashes or some of the namespaces in xenko have changed. It believe it is updating properly besides it locks up the mouse when I right click.

    var scene = SceneSystem.SceneInstance.Scene;
    var compositor = ((SceneGraphicsCompositorLayers)scene.Settings.GraphicsCompositor);
    compositor.Master.Renderers.Add(new SceneDelegateRenderer(Render));

    compositor.Master.Renderers doesn't exist anymore it has been moved or changed


    public class MainMenu : AsyncScript
    EmptyKeys.UserInterface.Generated.MainMenu uiRoot;
    private DebugViewModel debug;

    public override async Task Execute()
    SpriteFont font = await Content.LoadAsync<SpriteFont>("Segoe_UI_10_Regular");
    FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font);

    XenkoRenderer.GraphicsContext = Game.GraphicsContext;

    uiRoot = new EmptyKeys.UserInterface.Generated.MainMenu();
    debug = new DebugViewModel(uiRoot);
    // uiRoot.DataContext = new BasicUIViewModel();


    //var scene = SceneSystem.SceneInstance.RootScene;
    //SceneSystem.GraphicsCompositor.RenderSystem.Add(new DelegateSceneRenderer(Render));

    while (Game.IsRunning)
    await Script.NextFrame();
    private void Render(RenderDrawContext arg1/*, RenderFrame arg2*/)
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member

    23 May 2017 06:06 PM
    Yup, there are changes in latest Xenko. You can get new Xenko engine library here -

    You can replace render delegate code with this

                // Add Graphics Layer         
                var compositor = ((SceneRendererCollection)((SceneCameraRenderer)SceneSystem.GraphicsCompositor.Game).Child);            
                var uiRenderDelegate = new DelegateSceneRenderer(Render);
    You are not authorized to post a reply.