diff options
| author | arngo <[email protected]> | 2021-12-19 16:51:50 -0500 |
|---|---|---|
| committer | arngo <[email protected]> | 2021-12-19 16:51:50 -0500 |
| commit | c16f16066f1943a8c2d4178583578705e71e7794 (patch) | |
| tree | c2b28cfe5fd36d9ab9a7b004e2f72a48c7c8a023 /app/systems/title_screen.rb | |
| parent | 196e18f1fd61ea9ef0e985bf9a6463a1188747c9 (diff) | |
| download | SteelWings-c16f16066f1943a8c2d4178583578705e71e7794.tar.gz SteelWings-c16f16066f1943a8c2d4178583578705e71e7794.zip | |
make button change sprite when pressed/unpressed
Diffstat (limited to 'app/systems/title_screen.rb')
| -rw-r--r-- | app/systems/title_screen.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/systems/title_screen.rb b/app/systems/title_screen.rb index 0229720..0fa0a81 100644 --- a/app/systems/title_screen.rb +++ b/app/systems/title_screen.rb @@ -11,15 +11,15 @@ FF::Scn::TitleScreen.add( if mouse.x > hitbox.x and mouse.x < hitbox.x + hitbox.w and mouse.y > hitbox.y and mouse.y < hitbox.y + hitbox.h if $gtk.args.inputs.mouse.down btn.clicked = true - #sprite.props[:path] = '' - else + sprite.props[:path] = btn.pressed_sprite_path + elsif $gtk.args.inputs.mouse.up and btn.clicked btn.clicked = false - #sprite.props[:path] = '' - end - if $gtk.args.inputs.mouse.click + sprite.props[:path] = btn.unpressed_sprite_path btn.action.call - puts 'click' end + else + btn.clicked = false + sprite.props[:path] = btn.unpressed_sprite_path end end end |
