changed Color struct to 4 floats
GetRandomValue returns floats added GetRandomInt added Color4ub rgba 0-255 edited examples to work colour palette values could bare a double check!
This commit is contained in:
parent
ea70c47a1a
commit
b4d8f0b5d1
1 changed files with 475 additions and 359 deletions
|
|
@ -303,18 +303,18 @@ int main(int argc, char **argv)
|
|||
static void RandomizeEmoji(void)
|
||||
{
|
||||
hovered = selected = -1;
|
||||
int start = GetRandomValue(45, 360);
|
||||
int start = GetRandomInt(45, 360);
|
||||
|
||||
for (int i = 0; i < SIZEOF(emoji); ++i)
|
||||
{
|
||||
// 0-179 emoji codepoints (from emoji char array) each 4bytes + null char
|
||||
emoji[i].index = GetRandomValue(0, 179)*5;
|
||||
emoji[i].index = GetRandomInt(0, 179)*5;
|
||||
|
||||
// Generate a random color for this emoji
|
||||
Vector3 hsv = {(start*(i + 1))%360, 0.6f, 0.85f};
|
||||
emoji[i].color = Fade(ColorFromHSV(hsv), 0.8f);
|
||||
|
||||
// Set a random message for this emoji
|
||||
emoji[i].message = GetRandomValue(0, SIZEOF(messages) - 1);
|
||||
emoji[i].message = GetRandomInt(0, SIZEOF(messages) - 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue