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:
@ -39,33 +39,33 @@ public class BasicShapes
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawText("some basic shapes available on raylib", 20, 20, 20, Color.DARKGRAY);
|
||||
DrawText("some basic shapes available on raylib", 20, 20, 20, Color.DarkGray);
|
||||
|
||||
DrawLine(18, 42, screenWidth - 18, 42, Color.BLACK);
|
||||
DrawLine(18, 42, screenWidth - 18, 42, Color.Black);
|
||||
|
||||
DrawCircle(screenWidth / 4, 120, 35, Color.DARKBLUE);
|
||||
DrawCircleGradient(screenWidth / 4, 220, 60, Color.GREEN, Color.SKYBLUE);
|
||||
DrawCircleLines(screenWidth / 4, 340, 80, Color.DARKBLUE);
|
||||
DrawCircle(screenWidth / 4, 120, 35, Color.DarkBlue);
|
||||
DrawCircleGradient(screenWidth / 4, 220, 60, Color.Green, Color.SkyBlue);
|
||||
DrawCircleLines(screenWidth / 4, 340, 80, Color.DarkBlue);
|
||||
|
||||
DrawRectangle(screenWidth / 4 * 2 - 60, 100, 120, 60, Color.RED);
|
||||
DrawRectangleGradientH(screenWidth / 4 * 2 - 90, 170, 180, 130, Color.MAROON, Color.GOLD);
|
||||
DrawRectangleLines(screenWidth / 4 * 2 - 40, 320, 80, 60, Color.ORANGE);
|
||||
DrawRectangle(screenWidth / 4 * 2 - 60, 100, 120, 60, Color.Red);
|
||||
DrawRectangleGradientH(screenWidth / 4 * 2 - 90, 170, 180, 130, Color.Maroon, Color.Gold);
|
||||
DrawRectangleLines(screenWidth / 4 * 2 - 40, 320, 80, 60, Color.Orange);
|
||||
|
||||
DrawTriangle(
|
||||
new Vector2(screenWidth / 4 * 3, 80),
|
||||
new Vector2(screenWidth / 4 * 3 - 60, 150),
|
||||
new Vector2(screenWidth / 4 * 3 + 60, 150), Color.VIOLET
|
||||
new Vector2(screenWidth / 4 * 3 + 60, 150), Color.Violet
|
||||
);
|
||||
|
||||
DrawTriangleLines(
|
||||
new Vector2(screenWidth / 4 * 3, 160),
|
||||
new Vector2(screenWidth / 4 * 3 - 20, 230),
|
||||
new Vector2(screenWidth / 4 * 3 + 20, 230), Color.DARKBLUE
|
||||
new Vector2(screenWidth / 4 * 3 + 20, 230), Color.DarkBlue
|
||||
);
|
||||
|
||||
DrawPoly(new Vector2(screenWidth / 4 * 3, 320), 6, 80, 0, Color.BROWN);
|
||||
DrawPoly(new Vector2(screenWidth / 4 * 3, 320), 6, 80, 0, Color.Brown);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -40,7 +40,7 @@ public class BouncingBall
|
||||
{
|
||||
// Update
|
||||
//-----------------------------------------------------
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
pause = !pause;
|
||||
}
|
||||
@ -69,15 +69,15 @@ public class BouncingBall
|
||||
// Draw
|
||||
//-----------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawCircleV(ballPosition, ballRadius, Color.MAROON);
|
||||
DrawText("PRESS SPACE to PAUSE BALL MOVEMENT", 10, GetScreenHeight() - 25, 20, Color.LIGHTGRAY);
|
||||
DrawCircleV(ballPosition, ballRadius, Color.Maroon);
|
||||
DrawText("PRESS SPACE to PAUSE BALL MOVEMENT", 10, GetScreenHeight() - 25, 20, Color.LightGray);
|
||||
|
||||
// On pause, we draw a blinking message
|
||||
if (pause && ((framesCounter / 30) % 2) == 0)
|
||||
{
|
||||
DrawText("PAUSED", 350, 200, 30, Color.GRAY);
|
||||
DrawText("PAUSED", 350, 200, 30, Color.Gray);
|
||||
}
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class CollisionArea
|
||||
}
|
||||
|
||||
// Pause Box A movement
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
pause = !pause;
|
||||
}
|
||||
@ -100,26 +100,26 @@ public class CollisionArea
|
||||
// Draw
|
||||
//-----------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawRectangle(0, 0, screenWidth, screenUpperLimit, collision ? Color.RED : Color.BLACK);
|
||||
DrawRectangle(0, 0, screenWidth, screenUpperLimit, collision ? Color.Red : Color.Black);
|
||||
|
||||
DrawRectangleRec(boxA, Color.GOLD);
|
||||
DrawRectangleRec(boxB, Color.BLUE);
|
||||
DrawRectangleRec(boxA, Color.Gold);
|
||||
DrawRectangleRec(boxB, Color.Blue);
|
||||
|
||||
if (collision)
|
||||
{
|
||||
// Draw collision area
|
||||
DrawRectangleRec(boxCollision, Color.LIME);
|
||||
DrawRectangleRec(boxCollision, Color.Lime);
|
||||
|
||||
// Draw collision message
|
||||
int cx = GetScreenWidth() / 2 - MeasureText("COLLISION!", 20) / 2;
|
||||
int cy = screenUpperLimit / 2 - 10;
|
||||
DrawText("COLLISION!", cx, cy, 20, Color.BLACK);
|
||||
DrawText("COLLISION!", cx, cy, 20, Color.Black);
|
||||
|
||||
// Draw collision area
|
||||
string text = $"Collision Area: {(int)boxCollision.Width * (int)boxCollision.Height}";
|
||||
DrawText(text, GetScreenWidth() / 2 - 100, screenUpperLimit + 10, 20, Color.BLACK);
|
||||
DrawText(text, GetScreenWidth() / 2 - 100, screenUpperLimit + 10, 20, Color.Black);
|
||||
}
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
@ -27,27 +27,27 @@ public class ColorsPalette
|
||||
|
||||
Color[] colors = new[]
|
||||
{
|
||||
Color.DARKGRAY,
|
||||
Color.MAROON,
|
||||
Color.ORANGE,
|
||||
Color.DARKGREEN,
|
||||
Color.DARKBLUE,
|
||||
Color.DARKPURPLE,
|
||||
Color.DARKBROWN,
|
||||
Color.GRAY,
|
||||
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.DarkGray,
|
||||
Color.Maroon,
|
||||
Color.Orange,
|
||||
Color.DarkGreen,
|
||||
Color.DarkBlue,
|
||||
Color.DarkPurple,
|
||||
Color.DarkBrown,
|
||||
Color.Gray,
|
||||
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
|
||||
};
|
||||
|
||||
string[] colorNames = new[]
|
||||
@ -118,15 +118,15 @@ public class ColorsPalette
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawText("raylib colors palette", 28, 42, 20, Color.BLACK);
|
||||
DrawText("raylib colors palette", 28, 42, 20, Color.Black);
|
||||
DrawText(
|
||||
"press SPACE to see all colors",
|
||||
GetScreenWidth() - 180,
|
||||
GetScreenHeight() - 40,
|
||||
10,
|
||||
Color.GRAY
|
||||
Color.Gray
|
||||
);
|
||||
|
||||
// Draw all rectangles
|
||||
@ -134,16 +134,16 @@ public class ColorsPalette
|
||||
{
|
||||
DrawRectangleRec(colorsRecs[i], ColorAlpha(colors[i], colorState[i] != 0 ? 0.6f : 1.0f));
|
||||
|
||||
if (IsKeyDown(KeyboardKey.KEY_SPACE) || colorState[i] != 0)
|
||||
if (IsKeyDown(KeyboardKey.Space) || colorState[i] != 0)
|
||||
{
|
||||
DrawRectangle(
|
||||
(int)colorsRecs[i].X,
|
||||
(int)(colorsRecs[i].Y + colorsRecs[i].Height - 26),
|
||||
(int)colorsRecs[i].Width,
|
||||
20,
|
||||
Color.BLACK
|
||||
Color.Black
|
||||
);
|
||||
DrawRectangleLinesEx(colorsRecs[i], 6, ColorAlpha(Color.BLACK, 0.3f));
|
||||
DrawRectangleLinesEx(colorsRecs[i], 6, ColorAlpha(Color.Black, 0.3f));
|
||||
DrawText(
|
||||
colorNames[i],
|
||||
(int)(colorsRecs[i].X + colorsRecs[i].Width - MeasureText(colorNames[i], 10) - 12),
|
||||
|
@ -50,19 +50,19 @@ public class DrawCircleSector
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.6f));
|
||||
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.3f));
|
||||
DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.6f));
|
||||
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.3f));
|
||||
|
||||
DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, ColorAlpha(Color.MAROON, 0.3f));
|
||||
DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, ColorAlpha(Color.Maroon, 0.3f));
|
||||
DrawCircleSectorLines(
|
||||
center,
|
||||
outerRadius,
|
||||
startAngle,
|
||||
endAngle,
|
||||
segments,
|
||||
ColorAlpha(Color.MAROON, 0.6f)
|
||||
ColorAlpha(Color.Maroon, 0.6f)
|
||||
);
|
||||
|
||||
// Draw GUI controls
|
||||
@ -75,7 +75,7 @@ public class DrawCircleSector
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
minSegments = (int)MathF.Ceiling((endAngle - startAngle) / 90);
|
||||
Color color = (segments >= minSegments) ? Color.MAROON : Color.DARKGRAY;
|
||||
Color color = (segments >= minSegments) ? Color.Maroon : Color.DarkGray;
|
||||
DrawText($"MODE: {((segments >= minSegments) ? "MANUAL" : "AUTO")}", 600, 270, 10, color);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
@ -55,22 +55,22 @@ public class DrawRectangleRounded
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawLine(560, 0, 560, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.6f));
|
||||
DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.3f));
|
||||
DrawLine(560, 0, 560, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.6f));
|
||||
DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.3f));
|
||||
|
||||
if (drawRect)
|
||||
{
|
||||
DrawRectangleRec(rec, ColorAlpha(Color.GOLD, 0.6f));
|
||||
DrawRectangleRec(rec, ColorAlpha(Color.Gold, 0.6f));
|
||||
}
|
||||
if (drawRoundedRect)
|
||||
{
|
||||
DrawRectangleRounded(rec, roundness, segments, ColorAlpha(Color.MAROON, 0.2f));
|
||||
DrawRectangleRounded(rec, roundness, segments, ColorAlpha(Color.Maroon, 0.2f));
|
||||
}
|
||||
if (drawRoundedLines)
|
||||
{
|
||||
DrawRectangleRoundedLines(rec, roundness, segments, (float)lineThick, ColorAlpha(Color.MAROON, 0.4f));
|
||||
DrawRectangleRoundedLines(rec, roundness, segments, (float)lineThick, ColorAlpha(Color.Maroon, 0.4f));
|
||||
}
|
||||
|
||||
// Draw GUI controls
|
||||
@ -87,7 +87,7 @@ public class DrawRectangleRounded
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
string text = $"MODE: {((segments >= 4) ? "MANUAL" : "AUTO")}";
|
||||
DrawText(text, 640, 280, 10, (segments >= 4) ? Color.MAROON : Color.DARKGRAY);
|
||||
DrawText(text, 640, 280, 10, (segments >= 4) ? Color.Maroon : Color.DarkGray);
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
|
@ -56,10 +56,10 @@ public class DrawRing
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.6f));
|
||||
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.3f));
|
||||
DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.6f));
|
||||
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.3f));
|
||||
|
||||
if (drawRing)
|
||||
{
|
||||
@ -70,7 +70,7 @@ public class DrawRing
|
||||
startAngle,
|
||||
endAngle,
|
||||
segments,
|
||||
ColorAlpha(Color.MAROON, 0.3f)
|
||||
ColorAlpha(Color.Maroon, 0.3f)
|
||||
);
|
||||
}
|
||||
if (drawRingLines)
|
||||
@ -82,7 +82,7 @@ public class DrawRing
|
||||
startAngle,
|
||||
endAngle,
|
||||
segments,
|
||||
ColorAlpha(Color.BLACK, 0.4f)
|
||||
ColorAlpha(Color.Black, 0.4f)
|
||||
);
|
||||
}
|
||||
if (drawCircleLines)
|
||||
@ -93,7 +93,7 @@ public class DrawRing
|
||||
startAngle,
|
||||
endAngle,
|
||||
segments,
|
||||
ColorAlpha(Color.BLACK, 0.4f)
|
||||
ColorAlpha(Color.Black, 0.4f)
|
||||
);
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ public class DrawRing
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
minSegments = (int)MathF.Ceiling((endAngle - startAngle) / 90);
|
||||
Color color = (segments >= minSegments) ? Color.MAROON : Color.DARKGRAY;
|
||||
Color color = (segments >= minSegments) ? Color.Maroon : Color.DarkGray;
|
||||
DrawText($"MODE: {((segments >= minSegments) ? "MANUAL" : "AUTO")}", 600, 270, 10, color);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
@ -79,7 +79,7 @@ public class EasingsBallAnim
|
||||
// Reset state to play again
|
||||
else if (state == 3)
|
||||
{
|
||||
if (IsKeyPressed(KeyboardKey.KEY_ENTER))
|
||||
if (IsKeyPressed(KeyboardKey.Enter))
|
||||
{
|
||||
// Reset required variables to play again
|
||||
ballPositionX = -100;
|
||||
@ -89,7 +89,7 @@ public class EasingsBallAnim
|
||||
}
|
||||
}
|
||||
|
||||
if (IsKeyPressed(KeyboardKey.KEY_R))
|
||||
if (IsKeyPressed(KeyboardKey.R))
|
||||
{
|
||||
framesCounter = 0;
|
||||
}
|
||||
@ -98,18 +98,18 @@ public class EasingsBallAnim
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
if (state >= 2)
|
||||
{
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Color.GREEN);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Color.Green);
|
||||
}
|
||||
|
||||
DrawCircle(ballPositionX, 200, ballRadius, ColorAlpha(Color.RED, 1.0f - ballAlpha));
|
||||
DrawCircle(ballPositionX, 200, ballRadius, ColorAlpha(Color.Red, 1.0f - ballAlpha));
|
||||
|
||||
if (state == 3)
|
||||
{
|
||||
DrawText("PRESS [ENTER] TO PLAY AGAIN!", 240, 200, 20, Color.BLACK);
|
||||
DrawText("PRESS [ENTER] TO PLAY AGAIN!", 240, 200, 20, Color.Black);
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
|
@ -108,7 +108,7 @@ public class EasingsBoxAnim
|
||||
}
|
||||
|
||||
// Reset animation at any moment
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
rec = new Rectangle(GetScreenWidth() / 2, -100, 100, 100);
|
||||
rotation = 0.0f;
|
||||
@ -121,15 +121,15 @@ public class EasingsBoxAnim
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawRectanglePro(
|
||||
rec,
|
||||
new Vector2(rec.Width / 2, rec.Height / 2),
|
||||
rotation,
|
||||
ColorAlpha(Color.BLACK, alpha)
|
||||
ColorAlpha(Color.Black, alpha)
|
||||
);
|
||||
DrawText("PRESS [SPACE] TO RESET BOX ANIMATION!", 10, GetScreenHeight() - 25, 20, Color.LIGHTGRAY);
|
||||
DrawText("PRESS [SPACE] TO RESET BOX ANIMATION!", 10, GetScreenHeight() - 25, 20, Color.LightGray);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -90,7 +90,7 @@ public class EasingsRectangleArray
|
||||
rotation = Easings.EaseLinearIn(framesCounter, 0.0f, 360.0f, PlayTimeInFrames);
|
||||
}
|
||||
}
|
||||
else if ((state == 1) && IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
else if ((state == 1) && IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
// When animation has finished, press space to restart
|
||||
framesCounter = 0;
|
||||
@ -108,7 +108,7 @@ public class EasingsRectangleArray
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
if (state == 0)
|
||||
{
|
||||
@ -118,13 +118,13 @@ public class EasingsRectangleArray
|
||||
recs[i],
|
||||
new Vector2(recs[i].Width / 2, recs[i].Height / 2),
|
||||
rotation,
|
||||
Color.RED
|
||||
Color.Red
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (state == 1)
|
||||
{
|
||||
DrawText("PRESS [SPACE] TO PLAY AGAIN!", 240, 200, 20, Color.GRAY);
|
||||
DrawText("PRESS [SPACE] TO PLAY AGAIN!", 240, 200, 20, Color.Gray);
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
|
@ -82,15 +82,15 @@ public class FollowingEyes
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawCircleV(scleraLeftPosition, scleraRadius, Color.LIGHTGRAY);
|
||||
DrawCircleV(irisLeftPosition, irisRadius, Color.BROWN);
|
||||
DrawCircleV(irisLeftPosition, 10, Color.BLACK);
|
||||
DrawCircleV(scleraLeftPosition, scleraRadius, Color.LightGray);
|
||||
DrawCircleV(irisLeftPosition, irisRadius, Color.Brown);
|
||||
DrawCircleV(irisLeftPosition, 10, Color.Black);
|
||||
|
||||
DrawCircleV(scleraRightPosition, scleraRadius, Color.LIGHTGRAY);
|
||||
DrawCircleV(irisRightPosition, irisRadius, Color.DARKGREEN);
|
||||
DrawCircleV(irisRightPosition, 10, Color.BLACK);
|
||||
DrawCircleV(scleraRightPosition, scleraRadius, Color.LightGray);
|
||||
DrawCircleV(irisRightPosition, irisRadius, Color.DarkGreen);
|
||||
DrawCircleV(irisRightPosition, 10, Color.Black);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class LinesBezier
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
|
||||
SetConfigFlags(ConfigFlags.Msaa4xHint);
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - cubic-bezier lines");
|
||||
|
||||
Vector2 start = new(0, 0);
|
||||
@ -37,11 +37,11 @@ public class LinesBezier
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
|
||||
if (IsMouseButtonDown(MouseButton.Left))
|
||||
{
|
||||
start = GetMousePosition();
|
||||
}
|
||||
else if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON))
|
||||
else if (IsMouseButtonDown(MouseButton.Right))
|
||||
{
|
||||
end = GetMousePosition();
|
||||
}
|
||||
@ -50,10 +50,10 @@ public class LinesBezier
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, Color.GRAY);
|
||||
DrawLineBezier(start, end, 2.0f, Color.RED);
|
||||
DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, Color.Gray);
|
||||
DrawLineBezier(start, end, 2.0f, Color.Red);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -113,7 +113,7 @@ public class LogoRaylibAnim
|
||||
// State 4: Reset and Replay
|
||||
else if (state == 4)
|
||||
{
|
||||
if (IsKeyPressed(KeyboardKey.KEY_R))
|
||||
if (IsKeyPressed(KeyboardKey.R))
|
||||
{
|
||||
framesCounter = 0;
|
||||
lettersCount = 0;
|
||||
@ -134,7 +134,7 @@ public class LogoRaylibAnim
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
if (state == 0)
|
||||
{
|
||||
@ -165,7 +165,7 @@ public class LogoRaylibAnim
|
||||
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, outlineFade);
|
||||
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, outlineFade);
|
||||
|
||||
Color whiteFade = ColorAlpha(Color.RAYWHITE, alpha);
|
||||
Color whiteFade = ColorAlpha(Color.RayWhite, alpha);
|
||||
DrawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, whiteFade);
|
||||
|
||||
Color label = ColorAlpha(new Color(155, 79, 151, 255), alpha);
|
||||
@ -176,7 +176,7 @@ public class LogoRaylibAnim
|
||||
}
|
||||
else if (state == 4)
|
||||
{
|
||||
DrawText("[R] REPLAY", 340, 200, 20, Color.GRAY);
|
||||
DrawText("[R] REPLAY", 340, 200, 20, Color.Gray);
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
|
@ -38,14 +38,14 @@ public class LogoRaylibShape
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawRectangle(screenWidth / 2 - 128, screenHeight / 2 - 128, 256, 256, new Color(139, 71, 135, 255));
|
||||
DrawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, Color.RAYWHITE);
|
||||
DrawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, Color.RayWhite);
|
||||
DrawText("raylib", screenWidth / 2 - 44, screenHeight / 2 + 28, 50, new Color(155, 79, 151, 255));
|
||||
DrawText("cs", screenWidth / 2 - 44, screenHeight / 2 + 58, 50, new Color(155, 79, 151, 255));
|
||||
|
||||
DrawText("this is NOT a texture!", 350, 370, 10, Color.GRAY);
|
||||
DrawText("this is NOT a texture!", 350, 370, 10, Color.Gray);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -56,7 +56,7 @@ public class RectangleScaling
|
||||
CheckCollisionPointRec(mousePosition, area))
|
||||
{
|
||||
mouseScaleReady = true;
|
||||
if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
|
||||
if (IsMouseButtonPressed(MouseButton.Left))
|
||||
{
|
||||
mouseScaleMode = true;
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class RectangleScaling
|
||||
rec.Height = MOUSE_SCALE_MARK_SIZE;
|
||||
}
|
||||
|
||||
if (IsMouseButtonReleased(MouseButton.MOUSE_LEFT_BUTTON))
|
||||
if (IsMouseButtonReleased(MouseButton.Left))
|
||||
{
|
||||
mouseScaleMode = false;
|
||||
}
|
||||
@ -92,19 +92,19 @@ public class RectangleScaling
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
DrawText("Scale rectangle dragging from bottom-right corner!", 10, 10, 20, Color.GRAY);
|
||||
DrawRectangleRec(rec, ColorAlpha(Color.GREEN, 0.5f));
|
||||
DrawText("Scale rectangle dragging from bottom-right corner!", 10, 10, 20, Color.Gray);
|
||||
DrawRectangleRec(rec, ColorAlpha(Color.Green, 0.5f));
|
||||
|
||||
if (mouseScaleReady)
|
||||
{
|
||||
DrawRectangleLinesEx(rec, 1, Color.RED);
|
||||
DrawRectangleLinesEx(rec, 1, Color.Red);
|
||||
DrawTriangle(
|
||||
new Vector2(rec.X + rec.Width - MOUSE_SCALE_MARK_SIZE, rec.Y + rec.Height),
|
||||
new Vector2(rec.X + rec.Width, rec.Y + rec.Height),
|
||||
new Vector2(rec.X + rec.Width, rec.Y + rec.Height - MOUSE_SCALE_MARK_SIZE),
|
||||
Color.RED
|
||||
Color.Red
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user