リファレンス URL:application_get_position();

「配列 (Array) 」として戻り値

四つの座標値を格納した一つの配列として返す。戻り値は GGS ( Grobal Game Settings )の設定に依存する。

左上端を起点とした x , y 座標および、右下端の x , y 座標。各 x y 座標は Application Surface のレンダリング範囲を示す。



Windows OS の場合、ウィンドウモードで起動したアプリケーションはウィンドウサイズの拡大縮小が無ければ通常は 

    GameMaker_studio_1_4_function_test_application_get_position_surface_screenshot 0, 0, ウィンドウ幅, ウィンドウ高さ
が返って来る。値は application surface のサイズに変更が生じた時点で動的に変わる。動作中にウィンドウサイズを変更した例が以下。これも GGS の設定に依る。
    GameMaker_studio_1_4_function_test_application_get_position_surface_screenshot_2
GGS で全画面モード + Full Scale 設定で動作している場合
    GameMaker_studio_1_4_function_test_application_get_position_surface_screenshot_3 0, 0, モニタ解像度幅, モニタ解像度高さ
このように返って来る。 GGS でアスペクト比率変更を認めない設定の場合は、全画面でも Application Surface の縦横アスペクト比率は維持されるため値は環境依存、モニタ解像度と同じ値が返って来る保証は無い。
    GameMaker_studio_1_4_function_test_application_get_position_surface_screenshot_4
このように GGS 設定で Application Surface のサイズ変更の許可をどのように与えるかで、返って来る値は異なる。 スクリプト・サンプル
var a=application_get_position(); var b=70,c=100,d=25; if is_array(a) { draw_text(b,c,"Returned as array!");c+=d; draw_text(b,c,"tx = "+string(a[0]));c+=d; draw_text(b,c,"ty = "+string(a[1]));c+=d; draw_text(b,c,"bx = "+string(a[2]));c+=d; draw_text(b,c,"by = "+string(a[3]));c+=d; };
Functions/application_get_position

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.