axiosengine 

axiosengine Commit Details


Date:2012-06-03 15:42:25 (12 years 4 months ago)
Author:Natalie Adams
Branch:master
Commit:6f1d7e6d4dfbfac3c3756a629c4585319d789ed9
Parents: 4ba6fd89ee3c19b338541d52b0729e935ea24f9d
Message:Adding inputstate extension

Changes:

File differences

axios/Engine/Extensions/InputState.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameStateManagement;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace Axios.Engine.Extensions
{
public static class AxiosExtensions_InputState
{
// I got tired of always specifying Player one
//-- Nathan Adams [adamsna@datanethost.net] - 6/3/2012
/// <summary>
/// This checks if the key is pressed by player one
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool IsKeyPressed(this InputState input, Keys key)
{
PlayerIndex p;
return input.IsKeyPressed(key, PlayerIndex.One, out p);
}
public static bool IsButtonPressed(this InputState input, Buttons button)
{
PlayerIndex p;
return input.IsButtonPressed(button, PlayerIndex.One, out p);
}
public static bool IsNewKeyPress(this InputState input, Keys key)
{
PlayerIndex p;
return input.IsNewKeyPress(key, PlayerIndex.One, out p);
}
public static bool IsNewButtonPress(this InputState input, Buttons button)
{
PlayerIndex p;
return input.IsNewButtonPress(button, PlayerIndex.One, out p);
}
public static bool IsNewButtonRelease(this InputState input, Buttons button)
{
PlayerIndex p;
return input.IsNewButtonRelease(button, PlayerIndex.One, out p);
}
public bool IsNewKeyRelease(this InputState input, Keys key)
{
PlayerIndex p;
return input.IsNewKeyRelease(key, PlayerIndex.One, out p);
}
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05997s using 14 queries.