如何在 Corona SDK 中将矢量文件放入圆形?

我有一个 display.newCircle(),我想用一个矢量图像来填充它。我知道如何使用 'png' 文件来实现这一点,但无法在矢量图像上使用它。我正在使用 'svg' 文件,并使用以下方法导入:

 local nanosvg = require( "plugin.nanosvg" )
点赞
用户8576096
用户8576096

基本上这就是答案。

local nanosvg = require( "plugin.nanosvg" )

local tex = nanosvg.newTexture(
 { filename = "jelly.svg" })

image = display.newImage(tex.filename, tex.baseDir, display.contentCenterX, display.contentCenterY)
image.width = 100
image.height = 100
2017-09-20 18:26:41