Class: TyranoDsl::ElementsWriters::TitleScreenWriter

Inherits:
Object
  • Object
show all
Includes:
ElementsWritersModule
Defined in:
lib/tyrano_dsl/elements_writers/title_screen_writer.rb

Overview

Write the title screen

Instance Method Summary collapse

Instance Method Details

#write(world) ⇒ Array

Parameters:

Returns:

  • (Array)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tyrano_dsl/elements_writers/title_screen_writer.rb', line 11

def write(world)
  log {'Writing title screen'}
  background = get_background(world)
  first_scene = get_first_scene(world)

  content_text_content = title_screen_content(background, first_scene)
  preload_text_content = preload_text([background.target_long_file_name])
  [
      TyranoDsl::FileActions::CreateFile.new(
          File.join('data', 'scenario', "title_screen.ks"),
          content_text_content
      ),
      TyranoDsl::FileActions::CreateFile.new(
          File.join('data', 'scenario', 'system', "_title_screen.ks"),
          preload_text_content
      )

  ]
end