You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
868 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using Duality.Resources;
using Duality.Drawing;
using Duality.Input;
namespace BasicMenu
{
public class MouseCursorRenderer : Component, ICmpRenderer
{
float ICmpRenderer.BoundRadius
{
get { return float.MaxValue; }
}
bool ICmpRenderer.IsVisible(IDrawDevice device)
{
return
(device.VisibilityMask & VisibilityFlag.ScreenOverlay) != VisibilityFlag.None &&
(device.VisibilityMask & VisibilityFlag.AllGroups) != VisibilityFlag.None;
}
void ICmpRenderer.Draw(IDrawDevice device)
{
Canvas canvas = new Canvas(device);
// Draw the mouse cursor when available
if (DualityApp.Mouse.IsAvailable)
{
canvas.State.ColorTint = ColorRgba.White;
canvas.FillCircle(
DualityApp.Mouse.X,
DualityApp.Mouse.Y,
2);
}
}
}
}