mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Added logo, added Boot screen, renamed dump_config packet to upload_config, misc changes and UX improvements
This commit is contained in:
36
lib/states/boot.rb
Normal file
36
lib/states/boot.rb
Normal 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
|
||||
Reference in New Issue
Block a user