リファレンス URL:ptr(n);

「ポインタ型 (Pointer) 」として戻り値

* Version 1.4.1567 以降追加された関数要検証

実数型、文字列型、ポインタ型、int64、int32 型の変数に対してポインタ(メモリにおける位置を示す値)を得る際に利用する。

それ以外の変数型(例えば配列型とか)に利用した場合はプログラムが強制終了する。

(GML におけるポインタは特殊仕様なので、筆者も本家のドキュメント読んだだけではまだ理解できず
    GameMakerStudio_1_4_Function_test_ptr_screenshot
スクリプト・サンプル
if !is_ptr(bk1) { draw_text(50,50,"test1 = " + string(background_get_texture(bk1))); }; if is_ptr(ptr(bk1)) { draw_text(50,100,"test2 = " + string(ptr(bk1))); };
Functions/ptr

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.