Added logo, added Boot screen, renamed dump_config packet to upload_config, misc changes and UX improvements

This commit is contained in:
2020-06-08 16:08:41 -05:00
parent ef0174fb06
commit f04dfb01e7
13 changed files with 124 additions and 42 deletions

36
lib/states/boot.rb Normal file
View File

@@ -0,0 +1,36 @@
module TAC
class States
class Boot < CyberarmEngine::GuiState
def setup
stack width: 1.0, height: 1.0 do
background [TAC::Palette::TIMECRAFTERS_PRIMARY, TAC::Palette::TIMECRAFTERS_SECONDARY, TAC::Palette::TIMECRAFTERS_TERTIARY, TAC::Palette::TIMECRAFTERS_PRIMARY]
end
@title_font = CyberarmEngine::Text.new(TAC::NAME, z: 100, size: 72, shadow: true, shadow_size: 3, font: THEME[:Label][:font])
@logo = Gosu::Image.new("#{TAC::ROOT_PATH}/media/logo.png")
@animator = CyberarmEngine::Animator.new(start_time: 0, duration: 3_000, from: 0, to: 255)
@transition_color = Gosu::Color.new(0x00_000000)
end
def draw
super
@title_font.draw
@logo.draw(window.width / 2 - @logo.width / 2, window.height / 2 - @logo.height / 2, 99)
Gosu.draw_rect(0, 0, window.width, window.height, @transition_color, 10_00)
end
def update
super
@title_font.x = window.width / 2 - @title_font.width / 2
@title_font.y = window.height / 2 - (@logo.height / 2 + @title_font.height)
@transition_color.alpha = @animator.transition(0, 255, :sine)
push_state(Editor) if @transition_color.alpha >= 255
end
end
end
end