diff options
| author | realtradam <[email protected]> | 2022-05-16 20:30:47 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-05-16 20:30:47 -0400 |
| commit | d930066a204df290db6f7dcdd6d9ca890ec2f2f1 (patch) | |
| tree | 28ebdeb853a84da3bb3f2209c913c2d807b3fca7 | |
| parent | 6505c7d7390974a61bb7d23038184bf06d8f91c6 (diff) | |
| download | raylib-DrawTexturePro-interactive-demo-d930066a204df290db6f7dcdd6d9ca890ec2f2f1.tar.gz raylib-DrawTexturePro-interactive-demo-d930066a204df290db6f7dcdd6d9ca890ec2f2f1.zip | |
added origin markers
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | main.c | 50 |
3 files changed, 42 insertions, 15 deletions
@@ -1,2 +1,3 @@ game -output +output/* +lib/* @@ -1,4 +1,4 @@ desktop: - zig cc -target native main.c -o game -lGL -lm -lpthread -ldl -lrt -lX11 -Iraylib/src -Iraygui/src raylib/src/libraylib.a && ./game + zig cc -target native main.c -o game -lGL -lm -lpthread -ldl -lrt -lX11 -Iraylib/src -Iraygui/src lib/tux/libraylib.a && ./game web: - emcc -Os -Wall main.c -o game -Iraylib/src -Iraygui/src raylib/src/libraylib.a -o output/index.html -s USE_GLFW=3 -DPLATFORM_WEB --shell-file raylib/src/minshell.html -s TOTAL_MEMORY=268435456 -s ASYNCIFY --preload-file ./assets + emcc -Os -Wall main.c -o game -Iraylib/src -Iraygui/src lib/web/libraylib.a -o output/index.html -s USE_GLFW=3 -DPLATFORM_WEB --shell-file raylib/src/minshell.html -s TOTAL_MEMORY=268435456 -s ASYNCIFY --preload-file ./assets @@ -506,7 +506,6 @@ void DrawOutput() { } if (sourceRect.height < 0) { sourceRect.height *= -1; - } DrawRectangleLinesEx( (Rectangle) { @@ -621,6 +620,16 @@ void DrawOutput() { } DrawRectangleLinesEx( (Rectangle) { + .x = destRect.x - dtpOrigin.x, + .y = destRect.y - dtpOrigin.y, + .width = destRect.width, + .height = destRect.height, + }, + 1, + BLUE + ); + DrawRectangleLinesEx( + (Rectangle) { .x = destRect.x, .y = destRect.y, .width = destRect.width, @@ -629,11 +638,28 @@ void DrawOutput() { 2, DARKGREEN ); + DrawCircle( + destRect.x - dtpOrigin.x, + destRect.y - dtpOrigin.y, + 5, + BLUE + ); + DrawTextEx( + sourceCodeFont, + "Origin", + (Vector2) { + .x = destRect.x - 48 - dtpOrigin.x, + .y = destRect.y - fontSize + 16 - dtpOrigin.y + }, + fontSize, + fontSpacing, + BLUE + ); DrawTextEx( sourceCodeFont, "Dest", (Vector2) { - .x = destRect.x, + .x = destRect.x + 8, .y = destRect.y - fontSize + 1 }, fontSize, @@ -664,16 +690,16 @@ void DrawOutput() { ); //elementCode - sprintf(codePreviewArray[3], " .x = %d.0f,", (int)dtpSource.x); - sprintf(codePreviewArray[4], " .y = %d.0f,", (int)dtpSource.y); - sprintf(codePreviewArray[5], " .width = %d.0f,", (int)dtpSource.width); - sprintf(codePreviewArray[6], " .height = %d.0f", (int)dtpSource.height); - sprintf(codePreviewArray[9], " .x = %d.0f,", (int)dtpDest.x); - sprintf(codePreviewArray[10], " .y = %d.0f,", (int)dtpDest.y); - sprintf(codePreviewArray[11], " .width = %d.0f,", (int)dtpDest.width); - sprintf(codePreviewArray[12], " .height = %d.0f", (int)dtpDest.height); - sprintf(codePreviewArray[15], " .x = %d.0f,", (int)dtpOrigin.x); - sprintf(codePreviewArray[16], " .y = %d.0f,", (int)dtpOrigin.y); + sprintf(codePreviewArray[3], " .x = %d,", (int)dtpSource.x); + sprintf(codePreviewArray[4], " .y = %d,", (int)dtpSource.y); + sprintf(codePreviewArray[5], " .width = %d,", (int)dtpSource.width); + sprintf(codePreviewArray[6], " .height = %d", (int)dtpSource.height); + sprintf(codePreviewArray[9], " .x = %d,", (int)dtpDest.x); + sprintf(codePreviewArray[10], " .y = %d,", (int)dtpDest.y); + sprintf(codePreviewArray[11], " .width = %d,", (int)dtpDest.width); + sprintf(codePreviewArray[12], " .height = %d", (int)dtpDest.height); + sprintf(codePreviewArray[15], " .x = %d,", (int)dtpOrigin.x); + sprintf(codePreviewArray[16], " .y = %d,", (int)dtpOrigin.y); sprintf(codePreviewArray[18], " %d, // Rotation", (int)dtpRotation); for(i = 0; i < 21; i += 1) { |
