RonenNess / GeonBit.UI

UI system for MonoGame projects.
MIT License
478 stars 64 forks source link

How do you embed this into the WPF? #74

Closed ClEngine closed 6 years ago

ClEngine commented 6 years ago

https://gitlab.com/MarcStan/MonoGame.Framework.WpfInterop/

I want to embed this UI in the Wpf application. But failed, he would not move or respond.

including the mouse, is fixed to the upper left corner.The input box can not enter anything,Can you help me to see what's the problem?

ClEngine commented 6 years ago

qq 20180624112904

RonenNess commented 6 years ago

Are you calling Update() properly every frame?

https://github.com/RonenNess/GeonBit.UI/blob/master/README.md#setup

ClEngine commented 6 years ago

I have done what I have done, but I still can not move.

public class SceneEditor : WpfGame
    {
        private IGraphicsDeviceService graphicsDeviceService;
        private SpriteBatch spriteBatch;

        protected override void Initialize()
        {
            graphicsDeviceService = new WpfGraphicsDeviceService(this);

            base.Initialize();

            UserInterface.Initialize(Content, BuiltinThemes.editor);
        }

        protected override void LoadContent()
        {
            base.LoadContent();

            spriteBatch = new SpriteBatch(GraphicsDevice);
        }

        protected override void Update(GameTime gameTime)
        {
            UserInterface.Active.Update(gameTime);

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            UserInterface.Active.Draw(spriteBatch);

            base.Draw(gameTime);
        }
    }

image

RonenNess commented 6 years ago

From your other issue I understand this was solved? What was the problem?

Thanks!

ClEngine commented 6 years ago

Do you see the cursor in my upper left corner? No matter how I move my mouse, he will not move

RonenNess commented 6 years ago

But you uploaded another issue where the cursor is not in the corner:

https://github.com/RonenNess/GeonBit.UI/issues/76

How did that happen?

ClEngine commented 6 years ago

https://gitlab.com/MarcStan/MonoGame.Framework.WpfInterop/

I use this library to make wpf carry the game, another is to directly create a new monogame project

This is two questions. My English is not good, please forgive me

ClEngine commented 6 years ago

https://gitlab.com/MarcStan/MonoGame.Framework.WpfInterop/issues/22

This is the final conclusion. Maybe I should change my mind