public override void Draw(SpriteBatch sprite, SkeletonMeshRenderer skeletonMeshRenderer, GameTime gameTime, int mapShiftX, int mapShiftY, int centerX, int centerY, int RenderWidth, int RenderHeight, float RenderObjectScaling, MapRenderResolution mapRenderResolution, int TickCount) { // control minimap render UI position via // Position.X, Position.Y // Draw the main drame base.Draw(sprite, skeletonMeshRenderer, gameTime, 0, 0, centerX, centerY, RenderWidth, RenderHeight, RenderObjectScaling, mapRenderResolution, TickCount); int minimapPosX = (mapShiftX + (RenderWidth / 2)) / 16; int minimapPosY = (mapShiftY + (RenderHeight / 2)) / 16; item_pixelDot.Draw(sprite, skeletonMeshRenderer, gameTime, -Position.X, -Position.Y, minimapPosX, minimapPosY, RenderWidth, RenderHeight, RenderObjectScaling, mapRenderResolution, TickCount); }
/// <summary> /// Draw /// </summary> /// <param name="sprite"></param> /// <param name="skeletonMeshRenderer"></param> /// <param name="gameTime"></param> /// <param name="mapShiftX"></param> /// <param name="mapShiftY"></param> /// <param name="centerX"></param> /// <param name="centerY"></param> /// <param name="renderWidth"></param> /// <param name="renderHeight"></param> /// <param name="RenderObjectScaling"></param> /// <param name="mapRenderResolution"></param> /// <param name="TickCount"></param> public override void Draw(SpriteBatch sprite, SkeletonMeshRenderer skeletonMeshRenderer, GameTime gameTime, int mapShiftX, int mapShiftY, int centerX, int centerY, int renderWidth, int renderHeight, float RenderObjectScaling, MapRenderResolution mapRenderResolution, int TickCount) { Point MousePos = Mouse.GetState().Position; // relative to the window already if ((mouseCursorItemStates & (int)MouseCursorItemStates.LeftPress) != (int)MouseCursorItemStates.LeftPress && (mouseCursorItemStates & (int)MouseCursorItemStates.RightPress) != (int)MouseCursorItemStates.RightPress) // default { base.Draw(sprite, skeletonMeshRenderer, gameTime, -MousePos.X, -MousePos.Y, centerX, centerY, renderWidth, renderHeight, RenderObjectScaling, mapRenderResolution, TickCount); } else // if left or right press is active, draw pressed state { cursorItemPressedState.Draw(sprite, skeletonMeshRenderer, gameTime, -MousePos.X, -MousePos.Y, centerX, centerY, renderWidth, renderHeight, RenderObjectScaling, mapRenderResolution, TickCount); } }