Material Box

Material Box

WEBデザイン & フリー素材

Godot - Buttonを無効にする

Godot

GDScriptからButtonノードを無効にする方法とコード例です。


Buttonの機能を一時的に無効にするには「disabled」プロパティに「false」を指定します。
無効となったButtonノードのスタイルは、styleboxの「disabled」関連にて変更する事が可能です。

# Buttonノードを作成する
var button = Button.new()
add_child(button)
button.set_text("Button")

# ボタンを無効にする
button.disabled = true

再度、buttonを有効する場合は「disabled」プロパティに「true」を指定します。

# ボタンを表示する
button.disabled = true

Godot

TitleGodot - Buttonを無効にする

CategoryGodot

Created

Update

AuthorYousuke.U