display_set_gui_size()


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

display_set_gui_size()

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

書式

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

戻り値

N/A

機能

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.

Example

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.

Wiki内検索

#search(): You already view a search box

MENU

ドキュメント

GMLリファレンス

2ch

その他



最新の30件

2019-09-27 2019-07-28 2019-07-12 2018-11-17 2017-11-07 2017-10-26 2017-10-01 2017-05-13 2016-10-01 2017-01-22 2017-01-14 2016-12-25 2016-10-09 2016-09-21 2016-08-29 2016-06-21 2016-02-23 2016-02-10 2016-01-18 2015-10-30 2015-10-20 2015-06-23 2015-06-20 2015-06-19 2015-06-10

人気の10件

今日の10件



これまでの訪問者: 850
今日の訪問者: 2
昨日の訪問者: 0
閲覧者: 4