Game Maker Language リファレンス > 組み込み関数 用途別 > 2D グラフィック機能 > ディスプレイの設定 > display_set_gui_size


  • 対応:5.3A 6.0 6.1A 7.0
  • lite OK


display_set_gui_size(width, height);
GUIの幅( -1 と設定すると、ディスプレイやapplication_surfaceに対して、1:1の割合で等しくなります)
GUIの高さ( -1 と設定すると、ディスプレイやapplication_surfaceに対して、1:1の割合で等しくなります)




This function will only affect things drawn in the Draw GUI Event and can be used to set a specific width and height for all GUI components in that event, and no matter what size of display or window is used to display the GUI, it will be scaled to fit correctly. Where the GUI is positioned (ie: the (0,0) position) will depend on whether you have used the function display_set_gui_maximise() or not. If you do not use this function (the default setting) then the GUI layer will be positioned with its (0,0) point at the same position as that for the application surface (the area where your game is being drawn) and the width and height will be stretched to fit the this surface, such that setting a GUI width of 256px with this function when the application surface is 512px would stretch those 256 pixels to fit, effectively making the pixels twice as large. This is ideal for those games that have aspect ratio correction set in the global Game Settings.

If you have used the display_set_gui_maximise() function then the (0,0) position for the GUI layer will default to the top left corner of the game window, or display (when in fullscreen or on devices), with the scaling factor set by that function, and the width and height set by this one. You can reset the GUI layer at any time to the default configuration by calling this function using -1 as both the width and height - this will set the (0, 0) position to the application surface and the width and height will be reset to 1:1 with the surface too.


display_set_gui_size(768, 1024);

The above code will lock the draw GUI event to the given width and height, scaling all components to fit either the application surface, or the display, using that proportion.


#search(): You already view a search box







2020-06-28 2020-06-20 2020-05-27 2020-05-12 2020-05-10 2020-05-08 2020-05-07 2020-04-30 2020-04-28 2020-04-27



これまでの訪問者: 971
今日の訪問者: 1
昨日の訪問者: 1
閲覧者: 3