mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
d9b98693da
Can be used to create a circle, a polygon or a curved star
18 lines
364 B
GDScript
18 lines
364 B
GDScript
tool
|
|
extends "res://addons/material_maker/node_base.gd"
|
|
|
|
var shape
|
|
var sides
|
|
var radius
|
|
var edge
|
|
|
|
const SHAPES = [ "circle", "polygon", "star" ]
|
|
|
|
func _ready():
|
|
initialize_properties([ $shape, $sides, $radius, $edge ])
|
|
|
|
func _get_shader_code(uv):
|
|
var rv = { defs="", code="" }
|
|
rv.f = "%s(%s, %d, %f, %f)" % [ SHAPES[shape], uv, sides, radius, edge ]
|
|
return rv
|