Przeglądaj źródła

formatting

pull/5345/head
RobinsAviary 3 miesięcy temu
rodzic
commit
1bd7722557
1 zmienionych plików z 6 dodań i 4 usunięć
  1. +6
    -4
      examples/textures/textures_sprite_stacking.c

+ 6
- 4
examples/textures/textures_sprite_stacking.c Wyświetl plik

@ -57,11 +57,13 @@ int main(void)
stackSpacing = Clamp(stackSpacing, 0.0f, 5.0f);
// Add a positive/negative offset to spin right/left at different speeds
if (IsKeyDown(KEY_LEFT) || IsKeyDown(KEY_A)) {
if (IsKeyDown(KEY_LEFT) || IsKeyDown(KEY_A))
{
rotationSpeed -= speedChange;
}
if (IsKeyDown(KEY_RIGHT) || IsKeyDown(KEY_D)) {
if (IsKeyDown(KEY_RIGHT) || IsKeyDown(KEY_D))
{
rotationSpeed += speedChange;
}
@ -82,7 +84,8 @@ int main(void)
float scaledHeight = frameHeight*stackScale;
// Draw the stacked sprite, rotated to the correct angle, with an vertical offset applied based on its y location
for (int i = stackCount - 1; i >= 0; i--) {
for (int i = stackCount - 1; i >= 0; i--)
{
Rectangle source = { 0.0f, (float)i*frameHeight, frameWidth, frameHeight };
// Center vertically
Rectangle dest = { screenWidth/2.0f, (screenHeight/2.0f) + (i*stackSpacing) - (stackSpacing*stackCount/2.0f), scaledWidth, scaledHeight };
@ -103,7 +106,6 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadTexture(booth);
CloseWindow(); // Close window and OpenGL context

Ładowanie…
Anuluj
Zapisz