REVIEWED: DrawLineDashed()

This commit is contained in:
Ray
2025-10-02 13:38:13 +02:00
parent 36d3c8acfb
commit 7e3b7cd349
3 changed files with 59 additions and 69 deletions

View File

@@ -16,8 +16,6 @@
********************************************************************************************/
#include "raylib.h"
#define RAYGUI_IMPLEMENTATION
#include "raygui.h" // Required for GUI controls
//------------------------------------------------------------------------------------
// Program main entry point
@@ -42,6 +40,7 @@ int main(void)
int colorIndex = 0;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
@@ -50,8 +49,6 @@ int main(void)
//----------------------------------------------------------------------------------
lineEndPosition = GetMousePosition(); // Line endpoint follows the mouse
// --- Keyboard Controls ---
// Change Dash Length (UP/DOWN arrows)
if (IsKeyDown(KEY_UP)) dashLength += 1.0f;
if (IsKeyDown(KEY_DOWN) && dashLength > 1.0f) dashLength -= 1.0f;
@@ -61,11 +58,7 @@ int main(void)
if (IsKeyDown(KEY_LEFT) && blankLength > 1.0f) blankLength -= 1.0f;
// Cycle through colors ('C' key)
if (IsKeyPressed(KEY_C))
{
colorIndex = (colorIndex + 1) % (sizeof(lineColors)/sizeof(Color));
}
if (IsKeyPressed(KEY_C)) colorIndex = (colorIndex + 1)%(sizeof(lineColors)/sizeof(Color));
//----------------------------------------------------------------------------------
// Draw