Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constexpr int count = 5;
- static float times[count] = zero;
- for(int i = 0; i < count; i++)
- {
- s_v2 size = v2(200, 64);
- size.x += times[i] * 20;
- s_v2 pos = v2(c_world_size.x - size.x, 400 + i * 100);
- pos.x -= times[i] * 10;
- if(mouse_collides_rect_tl(input->mouse, pos, size))
- {
- times[i] = clamp(times[i] + delta * 10, 0.0f, 1.0f);
- }
- else
- {
- times[i] = clamp(times[i] - delta * 2, 0.0f, 1.0f);
- }
- s_v4 col = lerp_v4(WHITE, GREEN, times[i]);
- ui_rect(pos, size, col);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement