-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7aa1e26
commit b7a9c3d
Showing
4 changed files
with
92 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "optionsslider.h" | ||
|
||
#include "../../../profile/games/cclcc/optionsmenu.h" | ||
#include "../../../renderer/renderer.h" | ||
|
||
using namespace Impacto::Profile::CCLCC::OptionsMenu; | ||
|
||
namespace Impacto { | ||
namespace UI { | ||
namespace Widgets { | ||
namespace CCLCC { | ||
|
||
OptionsSlider::OptionsSlider(const Sprite& box, const Sprite& label, | ||
glm::vec2 pos) | ||
: BoxSprite(box), LabelSprite(label) { | ||
Bounds = RectF(pos.x, pos.y, SliderTrackOffset.x + box.ScaledWidth(), | ||
LabelSprite.ScaledHeight()); | ||
} | ||
|
||
void OptionsSlider::Render() { | ||
HighlightTint.a = Tint.a; | ||
glm::vec4 black = glm::vec4(0.0f, 0.0f, 0.0f, Tint.a); | ||
|
||
Renderer->DrawSprite(LabelSprite, Bounds.GetPos(), black); | ||
|
||
RectF highlightBounds( | ||
Bounds.X + SliderTrackOffset.x, Bounds.Y + SliderTrackOffset.y, | ||
Progress * BoxSprite.ScaledWidth(), BoxSprite.ScaledHeight()); | ||
Renderer->DrawRect(highlightBounds, HighlightTint); | ||
|
||
Renderer->DrawSprite(BoxSprite, Bounds.GetPos() + SliderTrackOffset, Tint); | ||
} | ||
|
||
void OptionsSlider::UpdateInput() {} | ||
|
||
} // namespace CCLCC | ||
} // namespace Widgets | ||
} // namespace UI | ||
} // namespace Impacto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include "../../widget.h" | ||
#include "../../../spritesheet.h" | ||
|
||
namespace Impacto { | ||
namespace UI { | ||
namespace Widgets { | ||
namespace CCLCC { | ||
|
||
class OptionsSlider : public Widget { | ||
public: | ||
OptionsSlider(const Sprite& box, const Sprite& label, glm::vec2 pos); | ||
|
||
void Render() override; | ||
void UpdateInput() override; | ||
|
||
private: | ||
const Sprite& BoxSprite; | ||
const Sprite& LabelSprite; | ||
|
||
glm::vec4 HighlightTint = glm::vec4(0.94f, 0.49f, 0.59f, 1.0f); | ||
|
||
float Progress = 0.0f; | ||
}; | ||
|
||
} // namespace CCLCC | ||
} // namespace Widgets | ||
} // namespace UI | ||
} // namespace Impacto |