Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update enum/color names to match C# naming convention #224

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions Examples/Audio/ModulePlaying.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ public static int Main()
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
Expand Down Expand Up @@ -92,14 +92,14 @@ public static int Main()
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;

Expand All @@ -113,11 +113,11 @@ public static int Main()
}
}

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;
}
Expand Down Expand Up @@ -159,7 +159,7 @@ public static int Main()
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(Color.RAYWHITE);
ClearBackground(Color.RayWhite);

for (int i = MaxCircles - 1; i >= 0; i--)
{
Expand All @@ -171,9 +171,9 @@ public static int Main()
}

// 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();
//----------------------------------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions Examples/Audio/MusicStreamDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public static int Main()
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;

Expand All @@ -77,16 +77,16 @@ public static int Main()
// 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();
//----------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions Examples/Audio/SoundLoading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public static int Main()
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
if (IsKeyPressed(KeyboardKey.Space))
{
PlaySound(fxWav);
}

if (IsKeyPressed(KeyboardKey.KEY_ENTER))
if (IsKeyPressed(KeyboardKey.Enter))
{
PlaySound(fxOgg);
}
Expand All @@ -52,10 +52,10 @@ public static int Main()
// 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();
//----------------------------------------------------------------------------------
Expand Down
30 changes: 15 additions & 15 deletions Examples/Core/BasicScreenManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static int Main()
// TODO: Update TITLE screen variables here!

// Press enter to change to GAMEPLAY screen
if (IsKeyPressed(KeyboardKey.KEY_ENTER) || IsGestureDetected(Gesture.GESTURE_TAP))
if (IsKeyPressed(KeyboardKey.Enter) || IsGestureDetected(Gesture.Tap))
{
currentScreen = GameScreen.Gameplay;
}
Expand All @@ -89,7 +89,7 @@ public static int Main()
// TODO: Update GAMEPLAY screen variables here!

// Press enter to change to ENDING screen
if (IsKeyPressed(KeyboardKey.KEY_ENTER) || IsGestureDetected(Gesture.GESTURE_TAP))
if (IsKeyPressed(KeyboardKey.Enter) || IsGestureDetected(Gesture.Tap))
{
currentScreen = GameScreen.Ending;
}
Expand All @@ -100,7 +100,7 @@ public static int Main()
// TODO: Update ENDING screen variables here!

// Press enter to return to TITLE screen
if (IsKeyPressed(KeyboardKey.KEY_ENTER) || IsGestureDetected(Gesture.GESTURE_TAP))
if (IsKeyPressed(KeyboardKey.Enter) || IsGestureDetected(Gesture.Tap))
{
currentScreen = GameScreen.Title;
}
Expand All @@ -115,42 +115,42 @@ public static int Main()
//----------------------------------------------------------------------------------
BeginDrawing();

ClearBackground(Color.RAYWHITE);
ClearBackground(Color.RayWhite);

switch (currentScreen)
{
case GameScreen.Logo:
{
// TODO: Draw LOGO screen here!
DrawText("LOGO SCREEN", 20, 20, 40, Color.LIGHTGRAY);
DrawText("WAIT for 2 SECONDS...", 290, 220, 20, Color.GRAY);
DrawText("LOGO SCREEN", 20, 20, 40, Color.LightGray);
DrawText("WAIT for 2 SECONDS...", 290, 220, 20, Color.Gray);

}
break;
case GameScreen.Title:
{
// TODO: Draw TITLE screen here!
DrawRectangle(0, 0, screenWidth, screenHeight, Color.GREEN);
DrawText("TITLE SCREEN", 20, 20, 40, Color.DARKGREEN);
DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, Color.DARKGREEN);
DrawRectangle(0, 0, screenWidth, screenHeight, Color.Green);
DrawText("TITLE SCREEN", 20, 20, 40, Color.DarkGreen);
DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, Color.DarkGreen);

}
break;
case GameScreen.Gameplay:
{
// TODO: Draw GAMEPLAY screen here!
DrawRectangle(0, 0, screenWidth, screenHeight, Color.PURPLE);
DrawText("GAMEPLAY SCREEN", 20, 20, 40, Color.MAROON);
DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, Color.MAROON);
DrawRectangle(0, 0, screenWidth, screenHeight, Color.Purple);
DrawText("GAMEPLAY SCREEN", 20, 20, 40, Color.Maroon);
DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, Color.Maroon);

}
break;
case GameScreen.Ending:
{
// TODO: Draw ENDING screen here!
DrawRectangle(0, 0, screenWidth, screenHeight, Color.BLUE);
DrawText("ENDING SCREEN", 20, 20, 40, Color.DARKBLUE);
DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, Color.DARKBLUE);
DrawRectangle(0, 0, screenWidth, screenHeight, Color.Blue);
DrawText("ENDING SCREEN", 20, 20, 40, Color.DarkBlue);
DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, Color.DarkBlue);

}
break;
Expand Down
4 changes: 2 additions & 2 deletions Examples/Core/BasicWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public static int Main()
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(Color.RAYWHITE);
ClearBackground(Color.RayWhite);

DrawText("Congrats! You created your first window!", 190, 200, 20, Color.MAROON);
DrawText("Congrats! You created your first window!", 190, 200, 20, Color.Maroon);

EndDrawing();
//----------------------------------------------------------------------------------
Expand Down
44 changes: 22 additions & 22 deletions Examples/Core/Camera2dDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public static int Main()
//----------------------------------------------------------------------------------

// Player movement
if (IsKeyDown(KeyboardKey.KEY_RIGHT))
if (IsKeyDown(KeyboardKey.Right))
{
player.X += 2;
}
else if (IsKeyDown(KeyboardKey.KEY_LEFT))
else if (IsKeyDown(KeyboardKey.Left))
{
player.X -= 2;
}
Expand All @@ -79,11 +79,11 @@ public static int Main()
camera.Target = new Vector2(player.X + 20, player.Y + 20);

// Camera3D rotation controls
if (IsKeyDown(KeyboardKey.KEY_A))
if (IsKeyDown(KeyboardKey.A))
{
camera.Rotation--;
}
else if (IsKeyDown(KeyboardKey.KEY_S))
else if (IsKeyDown(KeyboardKey.S))
{
camera.Rotation++;
}
Expand Down Expand Up @@ -111,7 +111,7 @@ public static int Main()
}

// Camera3D reset (zoom and rotation)
if (IsKeyPressed(KeyboardKey.KEY_R))
if (IsKeyPressed(KeyboardKey.R))
{
camera.Zoom = 1.0f;
camera.Rotation = 0.0f;
Expand All @@ -121,45 +121,45 @@ public static int Main()
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(Color.RAYWHITE);
ClearBackground(Color.RayWhite);

BeginMode2D(camera);

DrawRectangle(-6000, 320, 13000, 8000, Color.DARKGRAY);
DrawRectangle(-6000, 320, 13000, 8000, Color.DarkGray);

for (int i = 0; i < MaxBuildings; i++)
{
DrawRectangleRec(buildings[i], buildColors[i]);
}

DrawRectangleRec(player, Color.RED);
DrawRectangleRec(player, Color.Red);

DrawRectangle((int)camera.Target.X, -500, 1, (int)(screenHeight * 4), Color.GREEN);
DrawRectangle((int)camera.Target.X, -500, 1, (int)(screenHeight * 4), Color.Green);
DrawLine(
(int)(-screenWidth * 10),
(int)camera.Target.Y,
(int)(screenWidth * 10),
(int)camera.Target.Y,
Color.GREEN
Color.Green
);

EndMode2D();

DrawText("SCREEN AREA", 640, 10, 20, Color.RED);
DrawText("SCREEN AREA", 640, 10, 20, Color.Red);

DrawRectangle(0, 0, (int)screenWidth, 5, Color.RED);
DrawRectangle(0, 5, 5, (int)screenHeight - 10, Color.RED);
DrawRectangle((int)screenWidth - 5, 5, 5, (int)screenHeight - 10, Color.RED);
DrawRectangle(0, (int)screenHeight - 5, (int)screenWidth, 5, Color.RED);
DrawRectangle(0, 0, (int)screenWidth, 5, Color.Red);
DrawRectangle(0, 5, 5, (int)screenHeight - 10, Color.Red);
DrawRectangle((int)screenWidth - 5, 5, 5, (int)screenHeight - 10, Color.Red);
DrawRectangle(0, (int)screenHeight - 5, (int)screenWidth, 5, Color.Red);

DrawRectangle(10, 10, 250, 113, ColorAlpha(Color.SKYBLUE, 0.5f));
DrawRectangleLines(10, 10, 250, 113, Color.BLUE);
DrawRectangle(10, 10, 250, 113, ColorAlpha(Color.SkyBlue, 0.5f));
DrawRectangleLines(10, 10, 250, 113, Color.Blue);

DrawText("Free 2d camera controls:", 20, 20, 10, Color.BLACK);
DrawText("- Right/Left to move Offset", 40, 40, 10, Color.DARKGRAY);
DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color.DARKGRAY);
DrawText("- A / S to Rotate", 40, 80, 10, Color.DARKGRAY);
DrawText("- R to reset Zoom and Rotation", 40, 100, 10, Color.DARKGRAY);
DrawText("Free 2d camera controls:", 20, 20, 10, Color.Black);
DrawText("- Right/Left to move Offset", 40, 40, 10, Color.DarkGray);
DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color.DarkGray);
DrawText("- A / S to Rotate", 40, 80, 10, Color.DarkGray);
DrawText("- R to reset Zoom and Rotation", 40, 100, 10, Color.DarkGray);

EndDrawing();
//----------------------------------------------------------------------------------
Expand Down
Loading