GetDisplayByIndex(integer)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » GetDisplayByIndex(integer) Version 2.2

説明

GetDisplayByIndex 関数は、指定されたインデックス番号に一致するディスプレイ・オブジェクトへのハンドルを返します。

引数

  • integer:
    ディスプレイのインデックス番号です。

戻り値

  • handle:
    ディスプレイ・オブジェクトへのハンドルを返します。

ハンドルに関連するデータを、Dump() 関数で出力します。

Lua
return function()
    -- Get the index number for "Display 1"
    local displayIndex = GetDisplayCollect()["Display 1"].INDEX
    -- return error text in case the index number is nil
    if displayIndex == nil then
        ErrPrintf('Something went wrong. It appears that there is no "display 1"')
        return
    end
    -- Dump all information about the display with the index number
    Printf("=============== START OF DUMP ===============")
    GetDisplayByIndex(displayIndex):Dump()
    Printf("================ END OF DUMP ================")
end
ヒント
この例では、GetDisplayCollect() 関数を用いてインデックス番号を取得します。各ディスプレイは Display Collect の子であり、以下の関数によっても同じ情報にアクセスできます。
GetDisplayCollect()["Display 1"]