Merging
Added new extension "byte.Lerp". Added new extension "Log" for "TraceLogLevel". Constructors on Color no longer just truncate the float value, but also round it (+ 0.5f). New static method on Color, "Color.Lerp". Added static method "FromHSV" to Color. Added new getter method "GetHSV" on Color. Added index security on the FilePathList indexer. Merged Rectangle extensions with the type itself as read-only methods. Merged Image extensions with the type itself. Merged Texture2D extensions with the type itself. New file "Raymath.Utils" with some useful methods taken from Unity. Added "MoveTowards" extensions to RaylibExtensions. Added "TranslateLocal" and "TranslateGlobal" to Transform. Added "Load", "Export", "ExportAsCode", "Format", "Crop", and "Unload" shortcut methods to Wave. Added "IsValid" property to Wave, Texture2D, Sound, Shader, RenderTexture2D, Music, Image, Model, Material, Font, and AudioStream. Added "IsPlaying" and "IsProcessed" properties to AudioStream. Added "Load", "Play", "Stop", "Pause", "Resume", "SetBufferSizeDefault", "SetPan", "SetPitch", "SetVolume", and "Unload" shortcut methods to AudioStream. Added "Load", "Export", and "Unload" methods to AutomationEventList. Added "Default" property to Font. Added "Load", "GetMaterial", "GetTexture", "SetTexture", "SetShader", and "Unload" methods to material. Added "Draw", "DrawInstanced", "Export", "ExportAsCode", "Upload", and "Unload" methods to Mesh. Added "Load", "LoadFromMesh", "Unload", and a lot of "Draw" overloads. Added "Load", "Play", "Pause", "Stop", "SetPan", "SetPitch", "SetVolume", "Seek", and "Unload" methods to Music. Added "Load" and "Unload" methods to RenderTexture2D. Added "Load", "LoadFromMemory", "GetLocationAttrib", "SetValue", "SetTexture", "SetMatrix", and "Unload" methods to Shader. Removed unnecessary "partial" declarations.
This commit is contained in:
parent
9811c0d129
commit
b84a0d4f12
31 changed files with 1090 additions and 395 deletions
|
|
@ -35,4 +35,68 @@ public partial struct AudioStream
|
|||
/// Number of channels (1-mono, 2-stereo)
|
||||
/// </summary>
|
||||
public uint Channels;
|
||||
|
||||
public readonly CBool IsValid => Raylib.IsAudioStreamValid(this);
|
||||
public readonly CBool IsPlaying => Raylib.IsAudioStreamPlaying(this);
|
||||
public readonly CBool IsProcessed => Raylib.IsAudioStreamProcessed(this);
|
||||
|
||||
public static AudioStream Load(uint sampleRate, uint sampleSize, uint channels)
|
||||
{
|
||||
return Raylib.LoadAudioStream(sampleRate, sampleSize, channels);
|
||||
}
|
||||
|
||||
public readonly void Play()
|
||||
{
|
||||
Raylib.PlayAudioStream(this);
|
||||
}
|
||||
|
||||
public readonly void Pause()
|
||||
{
|
||||
Raylib.PauseAudioStream(this);
|
||||
}
|
||||
|
||||
public readonly void Resume()
|
||||
{
|
||||
Raylib.ResumeAudioStream(this);
|
||||
}
|
||||
|
||||
public readonly void Stop()
|
||||
{
|
||||
Raylib.StopAudioStream(this);
|
||||
}
|
||||
|
||||
public static void SetBufferSizeDefault(int size)
|
||||
{
|
||||
Raylib.SetAudioStreamBufferSizeDefault(size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set pan for this audio stream where 0.5 is centered
|
||||
/// </summary>
|
||||
/// <param name="pan"></param>
|
||||
public void SetPan(float pan)
|
||||
{
|
||||
Raylib.SetAudioStreamPan(this, pan);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set pitch for this audio stream where 1.0 si base level
|
||||
/// </summary>
|
||||
public void SetPitch(float pitch)
|
||||
{
|
||||
Raylib.SetAudioStreamPitch(this, pitch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the volume from 0.0 to 1.0
|
||||
/// </summary>
|
||||
public void SetVolume(float volume)
|
||||
{
|
||||
Raylib.SetAudioStreamVolume(this, volume);
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
Raylib.UnloadAudioStream(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue