Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
replaceNode(type:id:newClass:)
Replaces the specified node with a node of new class type.
VisualShader.swift:448final func replaceNode(type: VisualShader.GType, id: Int32, newClass: StringName)
Other members in extension
Types
Type members
static let nodeIdInvalid: Int
Denotes invalid
VisualShader
node.static let nodeIdOutput: Int
Denotes output node of
VisualShader
.class var godotClassName: StringName
Instance members
var graphOffset: Vector2
The offset vector of the whole graph.
func addNode(type: VisualShader.GType, node: VisualShaderNode?, position: Vector2, id: Int32
) Adds the specified
node
to the shader.func addVarying(name: String, mode: VisualShader.VaryingMode, type: VisualShader.VaryingType
) Adds a new varying value node to the shader.
func canConnectNodes(type: VisualShader.GType, fromNode: Int32, fromPort: Int32, toNode: Int32, toPort: Int32
) -> Bool Returns
true
if the specified nodes and ports can be connected together.func connectNodes(type: VisualShader.GType, fromNode: Int32, fromPort: Int32, toNode: Int32, toPort: Int32
) -> GodotError Connects the specified nodes and ports.
func connectNodesForced(type: VisualShader.GType, fromNode: Int32, fromPort: Int32, toNode: Int32, toPort: Int32
) Connects the specified nodes and ports, even if they can’t be connected. Such connection is invalid and will not function properly.
func disconnectNodes(type: VisualShader.GType, fromNode: Int32, fromPort: Int32, toNode: Int32, toPort: Int32
) Connects the specified nodes and ports.
func getNode(type: VisualShader.GType, id: Int32
) -> VisualShaderNode? Returns the shader node instance with specified
type
andid
.func getNodeConnections(type: VisualShader.GType
) -> VariantCollection<GDictionary> Returns the list of connected nodes with the specified type.
func getNodeList(type: VisualShader.GType
) -> PackedInt32Array Returns the list of all nodes in the shader with the specified type.
func getNodePosition(type: VisualShader.GType, id: Int32
) -> Vector2 Returns the position of the specified node within the shader graph.
func getValidNodeId(type: VisualShader.GType
) -> Int32 Returns next valid node ID that can be added to the shader graph.
func hasVarying(name: String
) -> Bool Returns
true
if the shader has a varying with the givenname
.func isNodeConnection(type: VisualShader.GType, fromNode: Int32, fromPort: Int32, toNode: Int32, toPort: Int32
) -> Bool Returns
true
if the specified node and port connection exist.func removeNode(type: VisualShader.GType, id: Int32
) Removes the specified node from the shader.
func removeVarying(name: String
) Removes a varying value node with the given
name
. Prints an error if a node with this name is not found.func setMode(Shader.Mode
) Sets the mode of this shader.
func setNodePosition(type: VisualShader.GType, id: Int32, position: Vector2
) Sets the position of the specified node.