Skip to main content

Documentation Index

Fetch the complete documentation index at: https://rive-accessibility.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Represents sampling parameters applied when drawing an image, including wrapping and filtering behaviour. See also ImageSampler, ImageWrap, and ImageFilter. Check out Scripting demos to see a working example.
type DrawImage = {
  myImage: Image?,
  sampler: ImageSampler?,
}

function init(self: DrawImage, context: Context): boolean
  self.myImage = context:image('myImage')
  self.sampler = ImageSampler('clamp', 'clamp', 'bilinear')

  return true
end

function draw(self: DrawImage, renderer: Renderer)
  if self.myImage and self.sampler then
    renderer:drawImage(self.myImage, self.sampler, 'srcOver', 1)
  end
end

return function(): Node<DrawImage>
  return {
    myImage = nil,
    sampler = nil,
    init = init,
    draw = draw,
  }
end