FindTexture(string)

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

説明

FindTixture 関数は、そのテクスチャが存在する場合、入力テキスト文字列に一致するテクスチャへのハンドルを返します。

引数

  • string:
    テキスト文字列は、ファイルタイプを除いたテクスチャ名である必要があります。以下の例を参照してください。

戻り値

  • handle または nil:
    この関数は テクスチャ・ハンドルを返します。存在しない場合は nil を返します。

この例では、"button" というテクスチャに関する情報を Dump() 関数で出力します。

Lua
return function ()
-- Set a texture name.
local textureName = "button"
-- Get the handle of the texture.
local textureHandle = FindTexture(textureName)
-- Check if textureHandle returned something and provide feedback.
if textureHandle == nil then
ErrPrintf("Texture does not exist.")
else
Printf("=============== START OF DUMP ===============")
FindTexture(textureName):Dump()
Printf("================ END OF DUMP ================")
end
end