Icons now work way better and don't have the the 'Rayview cuts icons' bug. It actually was a bug in the lel-guecs Sprite class that was using the TextureRect from the source sprite. Now its initialized with the framesize from the .json. This also uses the new guecs::Icon, but I have to fix that as it doesn't scale correctly. Closes #2.
This commit is contained in:
parent
b311713064
commit
ff7111b006
22 changed files with 81 additions and 64 deletions
|
@ -35,7 +35,7 @@ namespace gui {
|
|||
$animation = $world->get<components::Animation>($boss_id);
|
||||
$animation.frame_width = $sprite_config.width;
|
||||
|
||||
$boss_image = textures::get($sprite_config.name);
|
||||
$boss_image = textures::get_sprite($sprite_config.name);
|
||||
sf::IntRect frame_rect{{0,0},{$sprite_config.width,$sprite_config.height}};
|
||||
$boss_image.sprite->setTextureRect(frame_rect);
|
||||
$boss_image.sprite->setScale({$sprite_config.scale, $sprite_config.scale});
|
||||
|
@ -52,13 +52,13 @@ namespace gui {
|
|||
void BossFightUI::configure_background() {
|
||||
auto& boss = $world->get<components::BossFight>($boss_id);
|
||||
|
||||
$boss_background = textures::get(boss.background);
|
||||
$boss_background = textures::get_sprite(boss.background);
|
||||
$boss_background.sprite->setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
|
||||
$status.set<Background>($status.MAIN, {$status.$parser});
|
||||
|
||||
if(boss.stage) {
|
||||
$boss_has_stage = true;
|
||||
$boss_stage = textures::get(*boss.stage);
|
||||
$boss_stage = textures::get_sprite(*boss.stage);
|
||||
$boss_stage.sprite->setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue