class

PatternGenerator

Inherits Godot::ImageTexture < Godot::Texture2D < Godot::Texture < Godot::Resource < Godot::RefCounted < Godot::Object < Reference < Object

Base procedural SVG and ImageTexture pattern generator for PatternMaterial / pattern_replace.gdshader.

Because PatternGenerator inherits from Godot::ImageTexture (< Texture2D), any generator subclass can be assigned directly into the custom_pattern texture slot in the Godot Inspector or via code, and automatically re-rasterizes its SVG whenever any @[Export] parameter is adjusted.

Constructors

new

Class methods

_godot_has_virtual_method(method_name : String) : Bool
_godot_register_node_class
godot_class_name
godot_parent_class_name

Instance methods

_godot_call_tool_button(button_name : String) : Void

Dispatches inspector tool button clicks on this object.

_godot_call_virtual(method_name : String, delta : Float64) : Void

Virtual method and property dispatch hooks overridden by class registration macros. Delta timestep is received with 64-bit precision (Float64).

_godot_call_virtual_with_data(method_name : String, args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void

Dispatches generic virtual methods with raw arguments and return buffer.

_godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void

Invoked by the GDExtension bridge when retrieving an exposed @export property.

_godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void

Invoked by the GDExtension bridge when setting an exposed @export property.

apply_to(material : ShaderMaterial) : self

Assigns this procedural pattern generator to a ShaderMaterial's custom_pattern parameter.

Source
bg_hex

Returns the background hex color (#000000 by default, or #ffffff when invert is true).

Source
build_svg_body(io : IO, size : Float64, fg : String, bg : String) : Void

Overridden by subclasses to emit SVG pattern elements into io within 0..size coordinate space.

Source
call(method : String, *args) : Pointer(Void)

Calls the named method on the object with variable arguments.

export_svg_path
Source
export_svg_path=(export_svg_path : String)
Source
fg_hex

Returns the foreground hex color (#ffffff by default, or #000000 when invert is true).

Source
invert
Source
invert=(val : Bool)
Source
pattern_offset
Source
pattern_offset=(val : Vector2)
Source
pattern_rotation
Source
pattern_rotation=(val : Float64)
Source
pointer=(val : Pointer(Void))
Source
refresh_pattern_button
Source
refresh_texture!

Rebuilds the in-memory ImageTexture from to_svg when backed by a live Godot instance.

Source
save_svg(path : String = @export_svg_path) : String

Writes the generated SVG string to path (supports res:// or filesystem paths) and returns the resolved path.

Source
save_svg_button
Source
tile_size
Source
tile_size=(val : Int64)
Source
to_image

Rasterizes to_svg into a Godot::Image when running inside Godot.

Source
to_svg

Generates the complete black-and-white repeating SVG document string for this pattern.

Source
view_size
Source
view_size=(val : Float64)
Source

Macros

autoload(*args, **kwargs)

DSL directives for in-body autoload configuration

autoload_node(*args, **kwargs)
build
create