Class: GTS::LoadingScreen

Inherits:
UI::SpriteStack show all
Defined in:
scripts/01450 Systems/09000 GTS/09000 GTS.rb

Overview

Class showing the loading during server requests

Constant Summary

Constants inherited from UI::SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes inherited from UI::SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods inherited from UI::SpriteStack

#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport) ⇒ LoadingScreen

Create a new LoadingScreen

Parameters:

  • viewport (Viewport)

    viewport used by the loading screen



930
931
932
933
934
935
936
937
938
939
# File 'scripts/01450 Systems/09000 GTS/09000 GTS.rb', line 930

def initialize(viewport)
  super(viewport)
  @texts = [
    ext_text(8997, 45),
    ext_text(8997, 46),
    ext_text(8997, 47)
  ]
  @text = add_text(2, @viewport.rect.height - 16, 0, 16, @texts.first, color: 2)
  @viewport.visible = false
end

Instance Method Details

#process

Blocking method that makes the “LoadingScreen” process it's loading display



942
943
944
945
946
947
948
949
# File 'scripts/01450 Systems/09000 GTS/09000 GTS.rb', line 942

def process
  @viewport.visible = true
  while Core::LOCK.locked?
    Graphics.update
    @text.text = @texts[Graphics.frame_count % 60 / 20] if Graphics.frame_count % 20 == 0
  end
  @viewport.visible = false
end