修改打包設置有兩種方法:
方法1
發布后修改,這個需要首先運行一下程序
然后看程序目錄C:\Users\shenmifangke\Desktop\項目導出文件夾\WindowsNoEditor\項目名稱\Saved\Config\WindowsNoEditor
這個文件夾中會有一個GameUserSettings.ini。按照下面進行修改即可。
簡單說下,如果不想搞懂直接修改的話 就是直接把mode結尾的都設置成2
1920的就是分辨率了,可以自己設置,不過超出電腦分辨率的它會自動忽視。
修改FullscreenMode的值可設置為全屏或窗口模式,0表示全屏模式,1表示窗口全屏模式,2表示窗口模式
[/Script/Engine.GameUserSettings]
bUseVSync=False ResolutionSizeX=1920 ResolutionSizeY=1080 LastUserConfirmedResolutionSizeX=1920 LastUserConfirmedResolutionSizeY=1080 WindowPosX=-1 WindowPosY=-1 FullscreenMode=2
LastConfirmedFullscreenMode=2
PreferredFullscreenMode=2
AudioQualityLevel=0
FrameRateLimit=0.000000 DesiredScreenWidth=1920 DesiredScreenHeight=1080
bUseDesiredScreenHeight=false //如果默認全屏,此項建議設為true。否則,當設定全屏分辨率大於顯示器支持的分辨率時會出現全屏時超過一個屏幕大小的情況(僅測試了雙屏顯示器的情況)
LastRecommendedScreenWidth=0.000000
LastRecommendedScreenHeight=0.000000
Version=5
[ScalabilityGroups] sg.ResolutionQuality=100 sg.ViewDistanceQuality=3 sg.AntiAliasingquality=3 sg.ShadowQuality=3 sg.postprocessquality=3 sg.TextureQuality=3 sg.EffectsQuality=3
全屏配置的說明:
This should default to fullscreen, using the native desktop resolution.
Note, that the double slashes are comments, and you can also set a custom resolution by uncommenting those lines, and setting bUseDesktopResolutionForFullscreen=False.
There are multiple fullscreen modes:
0 sets the game to true fullscreen.
1 sets the game to windowed fullscreen.
2 sets the game to windowed mode.
Also, for some reason when launching a standalone game from the editor, it completely seems to ignore the resolution values and just sets the resolution to some default. The packaged game should still use the correct resolution however.
方法2
導出前就修改好
C:\Users\shenmifangke\Documents\Unreal Projects\項目文件夾\Config
新建一個DefaultGameUserSettings.ini文件
里面填上上面的配置,發布以后就會自動成為上面配置的分辨率了
The DefaultGameUserSettings.ini file is only there to set scalability if it is the user's first time launching the game.
It's definitely good to set the default ini files, but if you ever changed your scalability settings after your first launch, you need to either clear your "Saved" folder each time or modify [ProjectName]\Saved\Config\Windows\GameUserSettings.ini instead.
It's usually a good practice to clear the saved folder (or rename it) if you want to test out a "first launch". In a "first launch" scenario, your DefaultGameUserSettings.ini will be used to create the GameUserSettings.ini. Any further launches no longer reference DefaultGameUserSettings, unless you clear the "Saved" folder.
參考:
[Tutorial] Creating an External Game Launcher [Settings Adjuster]