A simple .NET Framework to make 2D games quick and easy.
at main 1.4 kB view raw
1using Fjord.Input; 2 3namespace Fjord.Scenes; 4public class SceneKeyboard 5{ 6 public string SceneID { get; private set; } 7 8 public SceneKeyboard(string SceneID) 9 { 10 this.SceneID = SceneID; 11 } 12 13 public bool Down(Key key) 14 { 15 if (SceneHandler.Get(SceneID).MouseInsideScene) 16 return GlobalKeyboard.Down(key); 17 else 18 return false; 19 } 20 21 public bool Down(Key key, params Mod[] mods) 22 { 23 if (SceneHandler.Get(SceneID).MouseInsideScene) 24 return GlobalKeyboard.Down(key, mods); 25 else 26 return false; 27 } 28 29 public bool Pressed(Key key) 30 { 31 if (SceneHandler.Get(SceneID).MouseInsideScene) 32 return GlobalKeyboard.Pressed(key); 33 else 34 return false; 35 } 36 37 public bool Pressed(Key key, params Mod[] mods) 38 { 39 if (SceneHandler.Get(SceneID).MouseInsideScene) 40 return GlobalKeyboard.Pressed(key, mods); 41 else 42 return false; 43 } 44 45 public bool Released(Key key) 46 { 47 if (SceneHandler.Get(SceneID).MouseInsideScene) 48 return GlobalKeyboard.Released(key); 49 else 50 return false; 51 } 52 53 public bool Released(Key key, params Mod[] mods) 54 { 55 if (SceneHandler.Get(SceneID).MouseInsideScene) 56 return GlobalKeyboard.Released(key, mods); 57 else 58 return false; 59 } 60}