Nez.Portable/UI/IMGUI.cs
/// <summary>
/// begins an IMGUI window specifying where and how large it should be. If you are not using IMGUI in world space (for example, inside
/// a Scene with a scaled resolution policy) passing false for useRawMousePosition will use the Input.scaledMousePosition.
/// </summary>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
/// <param name="width">Width.</param>
/// <param name="height">Height.</param>
/// <param name="useRawMousePosition">If set to <c>true</c> use raw mouse position.</param>
begins an IMGUI window specifying where and how large it should be. If you are not using IMGUI in world space (for example, inside
a Scene with a scaled resolution policy) passing false for useRawMousePosition will use the Input.scaledMousePosition.
begins an IMGUI window specifying where and how large it should be . If you are not using IMGUI in world space ( for example inside a Scene with a scaled resolution policy ) passing false for useRawMousePosition will use the Input . scaledMousePosition .
public static void beginWindow(float x, float y, float width, float height, bool useRawMousePosition = true)
        {
            _spriteBatch.Begin();
            _spriteBatch.drawRect(x, y, width, height, WINDOW_COLOR);
            _elementX = x + ELEMENT_PADDING;
            _lastY = y;
            _windowWidth = width;
            _windowHeight = height;
            _elementWidth = _windowWidth - 2f * ELEMENT_PADDING;
            var mousePos = useRawMousePosition ? Input.rawMousePosition : Input.scaledMousePosition.ToPoint();
            _mouseInWorldCoords = mousePos - new Point(Core.graphicsDevice.Viewport.X, Core.graphicsDevice.Viewport.Y);
        }
public static void beginWindow ( float x , float y , float width , float height , bool useRawMousePosition = true ) { _spriteBatch . Begin ( ) ; _spriteBatch . drawRect ( x , y , width , height , WINDOW_COLOR ) ; _elementX = x + ELEMENT_PADDING ; _lastY = y ; _windowWidth = width ; _windowHeight = height ; _elementWidth = _windowWidth - 2f * ELEMENT_PADDING ; var mousePos = useRawMousePosition ? Input . rawMousePosition : Input . scaledMousePosition . ToPoint ( ) ; _mouseInWorldCoords = mousePos - new Point ( Core . graphicsDevice . Viewport . X , Core . graphicsDevice . Viewport . Y ) ; }
begins an IMGUI window specifying where and how large it should be.
begins an IMGUI window specifying where and how large it should be .
x
float
The x coordinate.
The x coordinate .
y
float
The y coordinate.
The y coordinate .
width
float
None
height
float
None
useRawMousePosition
bool
If set to true
If set to true