public void PostRenderCallback(PreUIRenderEvent @e) { if (MouseOverChest) { var textLen = ChestTooltipText.Length; var width = (textLen * 10); var root = @e.Root; var batch = root.SpriteBatch; var font = root.SmoothFont; var pos = new Vector2 { X = CursorPosX - 40, Y = CursorPosY - 28 }; var bg = new Rectangle(CursorPosX - 40, CursorPosY - 25, width, 20); var tex = new Texture2D(@e.Root.Graphics.GraphicsDevice, width, 20); var bgColour = Color.Black; Color[] data = new Color[width * 20]; for (int i = 0; i < data.Length; ++i) { data[i] = bgColour; } tex.SetData(data); batch.Draw(tex, bg, Color.Black); batch.DrawString(font, ChestTooltipText, pos, Color.DarkOrange); MouseOverChest = false; } }
public static DetourEvent PreUIDrawCallback(StaticContextAccessor accessor) { var @event = new PreUIRenderEvent(); FireEvent(@event); return(@event); }