3 #include <BLIB/Interfaces/GUI/Elements/RadioButton.hpp>
12 : Component(Component::HighlightState::HighlightedByMouse) {}
14 void HighlightRadioButtonComponent::setVisible(
bool visible) { base.setVisible(visible); }
16 void HighlightRadioButtonComponent::onElementUpdated() {
17 base.onElementUpdated();
18 highlight.setHidden(!getOwnerAs<bl::gui::RadioButton>().getValue());
21 void HighlightRadioButtonComponent::onRenderSettingChange() { base.onRenderSettingChange(); }
23 bl::ecs::Entity HighlightRadioButtonComponent::getEntity()
const {
return base.getEntity(); }
25 void HighlightRadioButtonComponent::doCreate(bl::engine::Engine& engine,
26 bl::gui::rdr::Renderer& renderer) {
28 highlight.create(engine, {100.f, 100.f});
29 highlight.setFillColor(sf::Color(252, 252, 23, 128));
30 highlight.setParent(base.getEntity());
33 void HighlightRadioButtonComponent::doSceneAdd(bl::rc::Overlay* overlay) {
34 Component::doSceneAdd(base, overlay);
35 highlight.addToScene(overlay, bl::rc::UpdateSpeed::Static);
38 void HighlightRadioButtonComponent::doSceneRemove() {
39 Component::doSceneRemove(base);
40 highlight.removeFromScene();
43 void HighlightRadioButtonComponent::handleAcquisition() {
46 const sf::FloatRect& acq = getOwnerAs<bl::gui::RadioButton>().getAcquisition();
47 highlight.scaleToSize({acq.width, acq.height});
50 void HighlightRadioButtonComponent::handleMove() { base.onMove(); }
52 sf::Vector2f HighlightRadioButtonComponent::getRequisition()
const {
return base.getRequisition(); }
All classes and functionality used for implementing the game editor.
HighlightRadioButtonComponent()
Creates the component.