cs381/as6/EnergyBarRaygui.hpp

47 lines
1.8 KiB
C++

/*******************************************************************************************
*
* LayoutName v1.0.0 - Tool Description
*
* LICENSE: Propietary License
*
* Copyright (c) 2022 raylib technologies. All Rights Reserved.
*
* Unauthorized copying of this file, via any medium is strictly prohibited
* This project is proprietary and confidential unless the owner allows
* usage in any other form by expresely written permission.
*
**********************************************************************************************/
#pragma once
#include "raygui.h"
#include "raylib.h"
inline constexpr int WINDOW_WIDTH = 700;
inline constexpr int WINDOW_HEIGHT = 460;
//----------------------------------------------------------------------------------
// Controls Functions Declaration
//----------------------------------------------------------------------------------
inline void DrawHud(float value, int stars) {
GuiProgressBar((Rectangle){72, 440, 120, 16}, "ENERGY", nullptr, value, 0, 1);
GuiLabel((Rectangle){24, 8, 120, 24}, TextFormat("STARS: x%d", stars));
}
inline void DrawMainMenu() {
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 100, WINDOW_HEIGHT / 2 - 60, 200, 40},
"GRAVITY SURFING");
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 200, WINDOW_HEIGHT / 2, 400, 60},
"LEFT CLICK to turn on gravity well and attract probe\n"
"Avoid hazards and collect stars to keep your meter from draining\n"
"If your meter runs out, gravity well turns off and you lose control\n"
"until you collect another star\n"
"Press SPACE or LEFT CLICK to start");
}
//------------------------------------------------------------------------------------
// Controls Functions Definitions (local)
//------------------------------------------------------------------------------------