material-maker/addons/material_maker/engine/gen_comment.gd
RodZill4 c121f7c00a Updated loader and random seed handling (#15)
Loader is not a lot more generic and deserialization code moved to generators.

There is now a small dice button on nodes that create random patterns that can be used to freeze the seed. Frozen nodes can thus be moved without affecting the seed.
Graph nodes can also transmit their seed to their children (this behavior can be enabled/disabled using the dice button at the top right of the graph pane).
2019-11-04 07:58:17 +01:00

42 lines
780 B
GDScript

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:
if !parameters.has("size"):
parameters.size = 4
func get_type() -> String:
return "comment"
func get_type_name() -> String:
return "Comment"
func get_parameter_defs() -> Array:
return []
func get_input_defs() -> Array:
return []
func get_output_defs() -> Array:
return []
func _serialize(data: Dictionary) -> Dictionary:
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)