Class: ScriptLoader::PSDKConfig
Instance Attribute Summary collapse
-
#running_in_full_screen ⇒ Boolean
readonly
If the game runs in fullscreen.
-
#viewport_offset_x ⇒ Integer
readonly
OffsetX of all the viewports.
-
#viewport_offset_y ⇒ Integer
readonly
OffsetY of all the viewports.
-
#vsync_enabled ⇒ Boolean
readonly
If the game runs in VSYNC.
-
#window_scale ⇒ Integer
readonly
The window scale.
Instance Method Summary collapse
-
#choose_best_resolution ⇒ Array<Integer>
Function that choose the best resolution.
-
#debug? ⇒ Boolean
Tell if the game is in Debug mode.
-
#release? ⇒ Boolean
Tell if the game is in Release mode.
Instance Attribute Details
#running_in_full_screen ⇒ Boolean (readonly)
Returns if the game runs in fullscreen.
7 8 9 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 7 def running_in_full_screen @running_in_full_screen end |
#viewport_offset_x ⇒ Integer (readonly)
Returns OffsetX of all the viewports.
11 12 13 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 11 def @viewport_offset_x end |
#viewport_offset_y ⇒ Integer (readonly)
Returns OffsetY of all the viewports.
13 14 15 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 13 def @viewport_offset_y end |
#vsync_enabled ⇒ Boolean (readonly)
Returns if the game runs in VSYNC.
9 10 11 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 9 def vsync_enabled @vsync_enabled end |
#window_scale ⇒ Integer (readonly)
Returns the window scale.
5 6 7 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 5 def window_scale @window_scale end |
Instance Method Details
#choose_best_resolution ⇒ Array<Integer>
Function that choose the best resolution
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 31 def choose_best_resolution @window_scale = Configs.display.window_scale @vsync_enabled = Configs.graphic.vsync_enabled @running_in_full_screen = Configs.display.is_fullscreen fix_scale fix_vsync fix_full_screen return editors_resolution if running_editor? native = [Configs.display.game_resolution.x, Configs.display.game_resolution.y] @viewport_offset_x = 0 @viewport_offset_y = 0 if @running_in_full_screen desired = [native.first * @window_scale, native.last * @window_scale].map(&:round) all_res = LiteRGSS::DisplayWindow.list_resolutions return native if all_res.include?(desired) if all_res.include?(native) @window_scale = 1 return native end return find_best_matching_resolution(native, desired, all_res) else return native end end |
#debug? ⇒ Boolean
Tell if the game is in Debug mode
24 25 26 27 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 24 def debug? @debug = !release? && ARGV.include?('debug') if @debug.nil? return @debug end |
#release? ⇒ Boolean
Tell if the game is in Release mode
17 18 19 20 |
# File 'scripts/00000 PSDK_CONFIG.rb', line 17 def release? @release = File.exist?('Data/Scripts.dat') if @release.nil? return @release end |