-
Notifications
You must be signed in to change notification settings - Fork 0
/
Crosshair.cs
37 lines (31 loc) · 943 Bytes
/
Crosshair.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using ShootingGallery.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
namespace ShootingGallery
{
public class Crosshair : WorldSpaceEntity
{
private const int crosshairRadius = 25;
public Crosshair() : base()
{
this._sprite = (Sprite)Resources.Load("crosshairs");
}
public override void Update(ref GameTime gameTime)
{
}
public override void Render(ref SpriteBatch _spriteBatch)
{
_spriteBatch.Draw(_sprite.GetTexture2D(),
Mouse.GetState().Position.ToVector2() - new Vector2(crosshairRadius, crosshairRadius),
Color.White);
}
}
}