Explorar o código

examples/renderer/20-blending: center alpha and instructional text.

Otherwise, it tends to get lost behind the "Source Code" tab in the web
builds, if the browser window is too small.
Ryan C. Gordon hai 4 meses
pai
achega
39be8a703f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      examples/renderer/20-blending/blending.c

+ 2 - 2
examples/renderer/20-blending/blending.c

@@ -195,8 +195,8 @@ SDL_AppResult SDL_AppIterate(void *appstate)
     SDL_RenderRects(renderer, panels, ROWS*COLS);
 
     /* Render UI text */
-    SDL_RenderDebugText(renderer, WINDOW_WIDTH - 176, WINDOW_HEIGHT - 20, "UP/DOWN: CHANGE ALPHA");
-    SDL_RenderDebugTextFormat(renderer, 0, WINDOW_HEIGHT - 20, "ALPHA: %d", alpha);
+    SDL_RenderDebugText(renderer, (WINDOW_WIDTH - 176) / 2, WINDOW_HEIGHT - 30, "UP/DOWN: CHANGE ALPHA");
+    SDL_RenderDebugTextFormat(renderer, (WINDOW_WIDTH - 80) / 2, WINDOW_HEIGHT - 20, "ALPHA: %d", alpha);
 
     /* Update textures alpha mod */
     SDL_SetTextureAlphaMod(red_rect_texture,   alpha);