浏览代码

Modify text_words_alignment.c (#5411)

pull/5414/head
RANDRIA Luca 4 天前
committed by GitHub
父节点
当前提交
d74556d35c
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 1 个文件被更改,包括 8 次插入7 次删除
  1. +8
    -7
      examples/text/text_words_alignment.c

+ 8
- 7
examples/text/text_words_alignment.c 查看文件

@ -19,6 +19,8 @@
#include "raymath.h" // Required for: Lerp()
#include <stdio.h>
typedef enum TextAlignment {
TEXT_ALIGN_LEFT = 0,
TEXT_ALIGN_TOP = 0,
@ -58,7 +60,7 @@ int main(void)
// And of course the font...
Font font = GetFontDefault();
// Intialize the alignment variables
// Initialize the alignment variables
TextAlignment hAlign = TEXT_ALIGN_CENTRE;
TextAlignment vAlign = TEXT_ALIGN_MIDDLE;
@ -72,8 +74,7 @@ int main(void)
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_LEFT))
{
hAlign = hAlign - 1;
if (hAlign < 0) hAlign = 0;
if (hAlign > 0) hAlign = hAlign - 1;
}
if (IsKeyPressed(KEY_RIGHT))
@ -84,8 +85,7 @@ int main(void)
if (IsKeyPressed(KEY_UP))
{
vAlign = vAlign - 1;
if (vAlign < 0) vAlign = 0;
if (vAlign > 0) vAlign = vAlign - 1;
}
if (IsKeyPressed(KEY_DOWN))
@ -95,7 +95,8 @@ int main(void)
}
// One word per second
wordIndex = (int)GetTime()%wordCount;
if (wordCount > 0) wordIndex = (int)GetTime()%wordCount;
else wordIndex = 0;
//----------------------------------------------------------------------------------
// Draw
@ -132,4 +133,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

正在加载...
取消
保存