Skip to content

Commit

Permalink
Added Keyboard.Main
Browse files Browse the repository at this point in the history
Added Mouse.Main
  • Loading branch information
vchelaru committed Sep 29, 2024
1 parent 3185f77 commit e9d0ac2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ public struct SoundEffectPlayInfo
public SoundEffect SoundEffect;
public double LastPlayTime;


}

//public struct SoundEffectInstancePlayInfo
//{
// public SoundEffectInstance SoundEffect;
// public double LastPlayTime;

//}

}
4 changes: 4 additions & 0 deletions Engines/FlatRedBallXNA/FlatRedBall/Input/Keyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public IReadOnlyCollection<Microsoft.Xna.Framework.Input.Keys> KeysTyped
}
}

/// <summary>
/// The main keyboard for the game.
/// </summary>
public static Keyboard Main => InputManager.Keyboard;

#endregion

Expand Down
7 changes: 7 additions & 0 deletions Engines/FlatRedBallXNA/FlatRedBall/Input/Mouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public PositionedObject GrabbedPositionedObject

DelegateBased1DInput scrollWheel;

/// <summary>
/// A 1D Input for the scroll wheel, where scroll wheel values will be normalized to be between -1 and 1 per wheel "tick".
/// </summary>
public I1DInput ScrollWheel
{
get
Expand Down Expand Up @@ -168,6 +171,10 @@ public float ScrollWheelChange
}
}

/// <summary>
/// The main mouse for the game.
/// </summary>
public static Mouse Main => InputManager.Mouse;

#if !MONOGAME && !FNA
public bool IsOwnerFocused
Expand Down
3 changes: 2 additions & 1 deletion Engines/FlatRedBallXNA/FlatRedBall/TimeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ struct VoidTaskResult { }
/// The amount of time in seconds since the game started running.
/// This value is updated once-per-frame so it will
/// always be the same value until the next frame is called.
/// This value does not consider pausing. To consider pausing, see CurrentScreenTime.
/// This value does not consider pausing, and it does not reset when
/// a new screen starts. To consider pausing, see CurrentScreenTime.
/// </summary>
/// <remarks>
/// This value can be used to uniquely identify a frame.
Expand Down
2 changes: 1 addition & 1 deletion FRBDK/Glue/Glue/Content/ContentTypes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ Camera,TRUE,QualifiedType = FlatRedBall.Camera,,,,,,,,,,,,,,FALSE,,,"Name=X, Typ
Effect (.fx),,QualifiedType = Microsoft.Xna.Framework.Graphics.Effect,,fx,,,,,,,,,,,,FALSE,,,,FALSE,,,,,TRUE,FALSE,,FALSE,FALSE,,EffectImporter,EffectProcessor,FALSE,,
Video (.wmv),,QualifiedType = Microsoft.Xna.Framework.Media.Video,,wmv,,,,,,,,,,,,FALSE,,,,FALSE,,,,,FALSE,FALSE,,FALSE,FALSE,,WmvImporter,VideoProcessor,FALSE,,
XactProject (.xap),,,,xap,,,,,,,,,,,,FALSE,,,,FALSE,,,,,FALSE,FALSE,,FALSE,FALSE,,XactImporter,XactProcessor,FALSE,,
SoundEffectInstance (.wav),TRUE,QualifiedType = Microsoft.Xna.Framework.Audio.SoundEffectInstance,,wav,,,,,,,"{THIS} = FlatRedBall.FlatRedBallServices.Load<Microsoft.Xna.Framework.Audio.SoundEffect>(@""{FILE_NAME}"", {CONTENT_MANAGER_NAME}).CreateInstance();",,,if(this.IsDisposed == false) { this.Stop(); this.Dispose(); },,FALSE,,,,,,,,,TRUE,FALSE,,FALSE,FALSE,,,,FALSE,,
SoundEffectInstance (.wav),TRUE,QualifiedType = Microsoft.Xna.Framework.Audio.SoundEffectInstance,,wav,,,,,,,"{THIS} = FlatRedBall.FlatRedBallServices.Load<Microsoft.Xna.Framework.Audio.SoundEffect>(@""{FILE_NAME}"", {CONTENT_MANAGER_NAME}).CreateInstance();",,,if(this.IsDisposed == false) { this.Stop(); this.Dispose(); },,FALSE,,,,,,,,,FALSE,FALSE,,FALSE,FALSE,,,,FALSE,,

0 comments on commit e9d0ac2

Please sign in to comment.