summaryrefslogtreecommitdiffhomepage
path: root/examples/text/text_input_box.c
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-10-25 01:21:16 -0700
committerGitHub <[email protected]>2021-10-25 10:21:16 +0200
commitdaeccd03ace3eacf7907ecca1a697c7d00961cf4 (patch)
tree0be2045a1003eed50c1456fd1a380ff970837233 /examples/text/text_input_box.c
parent086f76ba7abefb1b34e1baa353c5f69dfc5dafdc (diff)
downloadraylib-daeccd03ace3eacf7907ecca1a697c7d00961cf4.tar.gz
raylib-daeccd03ace3eacf7907ecca1a697c7d00961cf4.zip
Fix VC warnings for examples (#2085)
Diffstat (limited to 'examples/text/text_input_box.c')
-rw-r--r--examples/text/text_input_box.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c
index aeea4e15..2e7d9a55 100644
--- a/examples/text/text_input_box.c
+++ b/examples/text/text_input_box.c
@@ -25,7 +25,7 @@ int main(void)
char name[MAX_INPUT_CHARS + 1] = "\0"; // NOTE: One extra space required for null terminator char '\0'
int letterCount = 0;
- Rectangle textBox = { screenWidth/2 - 100, 180, 225, 50 };
+ Rectangle textBox = { screenWidth/2.0f - 100, 180, 225, 50 };
bool mouseOnText = false;
int framesCounter = 0;
@@ -85,10 +85,10 @@ int main(void)
DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, GRAY);
DrawRectangleRec(textBox, LIGHTGRAY);
- if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RED);
- else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, DARKGRAY);
+ if (mouseOnText) DrawRectangleLines((int)textBox.x, (int)textBox.y, (int)textBox.width, (int)textBox.height, RED);
+ else DrawRectangleLines((int)textBox.x, (int)textBox.y, (int)textBox.width, (int)textBox.height, DARKGRAY);
- DrawText(name, textBox.x + 5, textBox.y + 8, 40, MAROON);
+ DrawText(name, (int)textBox.x + 5, (int)textBox.y + 8, 40, MAROON);
DrawText(TextFormat("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY);
@@ -97,7 +97,7 @@ int main(void)
if (letterCount < MAX_INPUT_CHARS)
{
// Draw blinking underscore char
- if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, MAROON);
+ if (((framesCounter/20)%2) == 0) DrawText("_", (int)textBox.x + 8 + MeasureText(name, 40), (int)textBox.y + 12, 40, MAROON);
}
else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, GRAY);
}