material-maker/addons/material_maker/engine/gen_comment.gd

42 lines
780 B
GDScript3
Raw Normal View History

2019-10-12 08:30:46 +02:00
tool
extends MMGenTexture
class_name MMGenComment
"""
Comments to put in the graph
"""
var text : String = "Double-click to write a comment"
var size : Vector2 = Vector2(0, 0)
func _ready() -> void:
2019-10-12 08:30:46 +02:00
if !parameters.has("size"):
parameters.size = 4
func get_type() -> String:
2019-10-12 08:30:46 +02:00
return "comment"
func get_type_name() -> String:
2019-10-12 08:30:46 +02:00
return "Comment"
func get_parameter_defs() -> Array:
2019-10-12 08:30:46 +02:00
return []
func get_input_defs() -> Array:
2019-10-12 08:30:46 +02:00
return []
func get_output_defs() -> Array:
2019-10-12 08:30:46 +02:00
return []
func _serialize(data: Dictionary) -> Dictionary:
2019-10-12 08:30:46 +02:00
data.type = "comment"
data.text = text
data.size = { x=size.x, y=size.y }
return data
func _deserialize(data : Dictionary) -> void:
if data.has("text"):
text = data.text
if data.has("size"):
size = Vector2(data.size.x, data.size.y)