くんすとの備忘録

IT系技術メモ

移転しました。

15秒後に自動的にリダイレクトします。

ティラノスクリプトでウィンドウサイズを固定する設定

package.jsonにウィンドウサイズの設定を書くと思いますが、widthheightだけでは狙ったサイズになりません。 max_widthmax_heightも設定する必要があるようです。

例) ウィンドウサイズを960x540で固定したい場合

max_width、max_heightの設定がないとき

  • package.json
{
    "name": "tyranoscript",
    "main": "app://./index.html",
    "window": {
        "title": "setup tyrano engine",
        "icon": "link.png",
        "toolbar": false,
        "resizable": false,
        "frame": true,
        "width": 960,
        "height": 540,
        "position": "mouse"
    },
    "webkit": {
        "plugin": true
    }
}
  • プレビュー

f:id:kunst1080:20170317210659p:plain

このように、微妙に余白ができてしまいます。

max_width、max_heightの設定があるとき

{
    "name": "tyranoscript",
    "main": "app://./index.html",
    "window": {
        "title": "setup tyrano engine",
        "icon": "link.png",
        "toolbar": false,
        "resizable": false,
        "frame": true,
        "width": 960,
        "height": 540,
        "max_width": 960,  // ← これ
        "max_height": 540, // ← これ
        "position": "mouse"
    },
    "webkit": {
        "plugin": true
    }
}
  • プレビュー

f:id:kunst1080:20170317210822p:plain

きれいに表示されました。