ShaderArgument

A single uniform argument value to a shader function.

StructureiOS 17.0+macOS 14.0+tvOS 17.0+Shader.Argument in SwiftUI

Declaration

React
type ShaderArgument =
  | 'boundingRect'
  | { color: Color; }
  | { colorArray: Color[]; }
  | { float: number; }
  | { float2: { x: number; y: number; }; }
  | { float2: CGPoint; }
  | { float2: CGSize; }
  | { float2: CGVector; }
  | { float3: { x: number; y: number; z: number; }; }
  | { float4: { x: number; y: number; z: number; w: number; }; }
  | { floatArray: number[]; }
  | { image: Image; };
Swift
struct Argument

Pass a literal, or build one with SwiftUI.ShaderArgument from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • 'boundingRect'SwiftUI.ShaderArgument.boundingRect

    Returns an argument value representing the bounding rect of the shape or view that the shader is attached to, as float4(x, y, width, height). This value is undefined for shaders that do not have a natural bounding rect (e.g. filter effects drawn into GraphicsContext).

Type methods

See also

More in Drawing and shapes.