mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Update enum/color names to match C# naming convention (#224)
This commit is contained in:
@ -36,27 +36,27 @@ public class ModulePlaying
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X
|
||||
SetConfigFlags(ConfigFlags.Msaa4xHint); // NOTE: Try to enable MSAA 4X
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");
|
||||
|
||||
InitAudioDevice();
|
||||
|
||||
Color[] colors = new Color[14] {
|
||||
Color.ORANGE,
|
||||
Color.RED,
|
||||
Color.GOLD,
|
||||
Color.LIME,
|
||||
Color.BLUE,
|
||||
Color.VIOLET,
|
||||
Color.BROWN,
|
||||
Color.LIGHTGRAY,
|
||||
Color.PINK,
|
||||
Color.YELLOW,
|
||||
Color.GREEN,
|
||||
Color.SKYBLUE,
|
||||
Color.PURPLE,
|
||||
Color.BEIGE
|
||||
Color.Orange,
|
||||
Color.Red,
|
||||
Color.Gold,
|
||||
Color.Lime,
|
||||
Color.Blue,
|
||||
Color.Violet,
|
||||
Color.Brown,
|
||||
Color.LightGray,
|
||||
Color.Pink,
|
||||
Color.Yellow,
|
||||
Color.Green,
|
||||
Color.SkyBlue,
|
||||
Color.Purple,
|
||||
Color.Beige
|
||||
};
|
||||
|
||||
// Creates ome circles for visual effect
|
||||
@ -92,14 +92,14 @@ public class ModulePlaying
|
||||
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||
|
||||
// Restart music playing (stop and play)
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
StopMusicStream(music);
|
||||
PlayMusicStream(music);
|
||||
}
|
||||
|
||||
// Pause/Resume music playing
|
||||
if (IsKeyPressed(KeyboardKey.KEY_P))
|
||||
if (IsKeyPressed(KeyboardKey.P))
|
||||
{
|
||||
pause = !pause;
|
||||
|
||||
@ -113,11 +113,11 @@ public class ModulePlaying
|
||||
}
|
||||
}
|
||||
|
||||
if (IsKeyDown(KeyboardKey.KEY_DOWN))
|
||||
if (IsKeyDown(KeyboardKey.Down))
|
||||
{
|
||||
pitch -= 0.01f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_UP))
|
||||
else if (IsKeyDown(KeyboardKey.Up))
|
||||
{
|
||||
pitch += 0.01f;
|
||||
}
|
||||
@ -159,7 +159,7 @@ public class ModulePlaying
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
for (int i = MaxCircles - 1; i >= 0; i--)
|
||||
{
|
||||
@ -171,9 +171,9 @@ public class ModulePlaying
|
||||
}
|
||||
|
||||
// Draw time bar
|
||||
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.LIGHTGRAY);
|
||||
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, Color.MAROON);
|
||||
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.GRAY);
|
||||
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.LightGray);
|
||||
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, Color.Maroon);
|
||||
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.Gray);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -44,14 +44,14 @@ public class MusicStreamDemo
|
||||
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||
|
||||
// Restart music playing (stop and play)
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
StopMusicStream(music);
|
||||
PlayMusicStream(music);
|
||||
}
|
||||
|
||||
// Pause/Resume music playing
|
||||
if (IsKeyPressed(KeyboardKey.KEY_P))
|
||||
if (IsKeyPressed(KeyboardKey.P))
|
||||
{
|
||||
pause = !pause;
|
||||
|
||||
@ -77,16 +77,16 @@ public class MusicStreamDemo
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, Color.LIGHTGRAY);
|
||||
DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, Color.LightGray);
|
||||
|
||||
DrawRectangle(200, 200, 400, 12, Color.LIGHTGRAY);
|
||||
DrawRectangle(200, 200, (int)timePlayed, 12, Color.MAROON);
|
||||
DrawRectangleLines(200, 200, 400, 12, Color.GRAY);
|
||||
DrawRectangle(200, 200, 400, 12, Color.LightGray);
|
||||
DrawRectangle(200, 200, (int)timePlayed, 12, Color.Maroon);
|
||||
DrawRectangleLines(200, 200, 400, 12, Color.Gray);
|
||||
|
||||
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, Color.LIGHTGRAY);
|
||||
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, Color.LIGHTGRAY);
|
||||
DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, Color.LightGray);
|
||||
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, Color.LightGray);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -38,12 +38,12 @@ public class SoundLoading
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
PlaySound(fxWav);
|
||||
}
|
||||
|
||||
if (IsKeyPressed(KeyboardKey.KEY_ENTER))
|
||||
if (IsKeyPressed(KeyboardKey.Enter))
|
||||
{
|
||||
PlaySound(fxOgg);
|
||||
}
|
||||
@ -52,10 +52,10 @@ public class SoundLoading
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, Color.LIGHTGRAY);
|
||||
DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, Color.LIGHTGRAY);
|
||||
DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, Color.LightGray);
|
||||
DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, Color.LightGray);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user