mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-06 11:12:19 +00:00
add how to playbutton
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -85,6 +85,25 @@ namespace BBM
|
|||||||
|
|
||||||
texture->use("assets/buttons/button_back_hovered.png");
|
texture->use("assets/buttons/button_back_hovered.png");
|
||||||
});
|
});
|
||||||
|
auto &howToPlay = scene->addEntity("to to play")
|
||||||
|
.addComponent<PositionComponent>(1920 - 10 - 75, 1080 - 85, 0)
|
||||||
|
.addComponent<Drawable2DComponent, RAY::Texture>("assets/buttons/button_htp.png")
|
||||||
|
.addComponent<OnClickComponent>([](WAL::Entity &entity, WAL::Wal &)
|
||||||
|
{
|
||||||
|
gameState.nextScene = BBM::GameState::SceneID::MainMenuScene;
|
||||||
|
})
|
||||||
|
.addComponent<OnIdleComponent>([](WAL::Entity &entity, WAL::Wal &)
|
||||||
|
{
|
||||||
|
RAY::Texture *texture = dynamic_cast<RAY::Texture *>(entity.getComponent<Drawable2DComponent>().drawable.get());
|
||||||
|
|
||||||
|
texture->use("assets/buttons/button_htp.png");
|
||||||
|
})
|
||||||
|
.addComponent<OnHoverComponent>([](WAL::Entity &entity, WAL::Wal &)
|
||||||
|
{
|
||||||
|
RAY::Texture *texture = dynamic_cast<RAY::Texture *>(entity.getComponent<Drawable2DComponent>().drawable.get());
|
||||||
|
|
||||||
|
texture->use("assets/buttons/button_htp_hovered.png");
|
||||||
|
});
|
||||||
auto &lavaOption = scene->addEntity("lava option text")
|
auto &lavaOption = scene->addEntity("lava option text")
|
||||||
.addComponent<PositionComponent>(1920 / 6, 2 * 1080 / 3, 0)
|
.addComponent<PositionComponent>(1920 / 6, 2 * 1080 / 3, 0)
|
||||||
.addComponent<Drawable2DComponent, RAY2D::Text>("Lava: Off", 70, RAY::Vector2(), BLACK)
|
.addComponent<Drawable2DComponent, RAY2D::Text>("Lava: Off", 70, RAY::Vector2(), BLACK)
|
||||||
@@ -148,7 +167,8 @@ namespace BBM
|
|||||||
scene->addEntity("camera")
|
scene->addEntity("camera")
|
||||||
.addComponent<PositionComponent>(8, 20, 7)
|
.addComponent<PositionComponent>(8, 20, 7)
|
||||||
.addComponent<CameraComponent>(Vector3f(8, 0, 8));
|
.addComponent<CameraComponent>(Vector3f(8, 0, 8));
|
||||||
play.getComponent<OnClickComponent>().setButtonLinks(&lavaOption, &back, &back, nullptr);
|
play.getComponent<OnClickComponent>().setButtonLinks(&lavaOption, &back, &back, &howToPlay);
|
||||||
|
howToPlay.getComponent<OnClickComponent>().setButtonLinks(&play, nullptr, &play);
|
||||||
back.getComponent<OnClickComponent>().setButtonLinks(&play, nullptr, nullptr, &play);
|
back.getComponent<OnClickComponent>().setButtonLinks(&play, nullptr, nullptr, &play);
|
||||||
lavaOption.getComponent<OnClickComponent>().setButtonLinks(nullptr, &play, nullptr, &heightOption);
|
lavaOption.getComponent<OnClickComponent>().setButtonLinks(nullptr, &play, nullptr, &heightOption);
|
||||||
heightOption.getComponent<OnClickComponent>().setButtonLinks(nullptr, &play, &lavaOption, nullptr);
|
heightOption.getComponent<OnClickComponent>().setButtonLinks(nullptr, &play, &lavaOption, nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user