소스 검색

Create Beginners_-_String_To_Integers.c

Rudy Boudewijn van Etten 5 년 전
부모
커밋
cb2123e345
1개의 변경된 파일47개의 추가작업 그리고 0개의 파일을 삭제
  1. 47 0
      Beginners_-_String_To_Integers.c

+ 47 - 0
Beginners_-_String_To_Integers.c

@@ -0,0 +1,47 @@
+
+#include "raylib.h"
+#include "stdlib.h"
+
+int main(void)
+{
+    // Initialization
+    //--------------------------------------------------------------------------------------
+    const int screenWidth = 800;
+    const int screenHeight = 450;
+
+    InitWindow(screenWidth, screenHeight, "raylib example.");
+ 
+    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
+    //--------------------------------------------------------------------------------------
+
+    // Main game loop
+    while (!WindowShouldClose())    // Detect window close button or ESC key
+    {
+        // Update
+        //----------------------------------------------------------------------------------
+        
+        static int num;
+        static char con[10] = "  23";
+        num = atoi(con);
+        
+        //----------------------------------------------------------------------------------
+        // Draw
+        //----------------------------------------------------------------------------------
+        BeginDrawing();
+
+            ClearBackground(RAYWHITE);
+            DrawText(FormatText("%i",num),200,200,20,BLACK);    
+
+        EndDrawing();
+        //----------------------------------------------------------------------------------
+    }
+
+    // De-Initialization
+    //--------------------------------------------------------------------------------------
+    CloseWindow();        // Close window and OpenGL context
+    //--------------------------------------------------------------------------------------
+
+    return 0;
+
+
+}