Browse Source

Update Beginners_-_Sprite_Rotation.c

Rudy Boudewijn van Etten 5 năm trước cách đây
mục cha
commit
2a969a1cb4
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Beginners_-_Sprite_Rotation.c

+ 2 - 2
Beginners_-_Sprite_Rotation.c

@@ -55,7 +55,7 @@ int main(void)
     // Source rectangle (part of the texture to use for drawing)
     // Source rectangle (part of the texture to use for drawing)
     Rectangle sourceRec = { 0.0f, 0.0f, 32, 32 };
     Rectangle sourceRec = { 0.0f, 0.0f, 32, 32 };
     // Origin of the texture (rotation/scale point), it's relative to destination rectangle size
     // Origin of the texture (rotation/scale point), it's relative to destination rectangle size
-    Vector2 origin = { 32, 32 }; 
+    Vector2 origin = { 16, 16 }; 
  
  
     float rotation=0.0f;
     float rotation=0.0f;
     
     
@@ -79,7 +79,7 @@ int main(void)
 
 
             DrawText("Sprite Creation and Rotation.", 100, 180, 40, LIGHTGRAY);
             DrawText("Sprite Creation and Rotation.", 100, 180, 40, LIGHTGRAY);
 
 
-            DrawTexturePro(target.texture, sourceRec, (Rectangle){ GetMouseX(), GetMouseY(), 32*2, 32*2 }, origin, (float)rotation, WHITE);
+            DrawTexturePro(target.texture, sourceRec, (Rectangle){ GetMouseX(), GetMouseY(), 32, 32 }, origin, (float)rotation, WHITE);
  
  
 
 
         EndDrawing();
         EndDrawing();