ioxu / microscratches-generator

A texture generator for controlling the rotation of anisotropic reflection in shading models for 3d renderers.
MIT License
4 stars 0 forks source link

add tooltips to layers #7

Closed ioxu closed 1 year ago

ioxu commented 1 year ago

showing

ioxu commented 1 year ago

Adding a method to add arbitrary metadata to a layer through a dictionary, which gets updated into the Layer's tooltip string.

ioxu commented 1 year ago
func add_meta( key : String, value  )->void:
    self.meta[key] = value
    update_tooltip()

func update_tooltip() -> void:
    var tt = ""
    for k in self.meta.keys():
        tt += "%s : %s\n"%[k, str(self.meta[k])]
    self.hint_tooltip = tt
ioxu commented 1 year ago

Image