如何在lua中使用getPixel,getColor方法

时间:2018-04-19 01:52:02

标签: lua gideros

有人可以告诉我在lua中使用getPixel和getColor的正确方法。 我试过了

 pix = 5; piy = 5;
 getPixel(pix, piy) --getColor(pix, piy)

 image:getPixel(pix, piy) --image:getColor(pix, piy)

......我无法弄清楚lua在抱怨什么。

错误:  尝试致电全球' getPixel' (零值)

1 个答案:

答案 0 :(得分:0)

  

有人可以告诉我使用getPixel的正确方法吗?   lua中的getColor。

Lua不提供获取像素或颜色的功能。同样,正如您之前的问题一样,您可以在Gideros手册中找到这些内容。

  

getPixel(pix, piy) --image:getColor(pix, piy)

     

......我无法弄清楚lua在抱怨什么。

     

错误:尝试调用全局'getPixel'(零值)

Lua抱怨你叫一个零值。在您的全局环境中没有名为getPixel的变量。

再次打开Gideros手册:
http://docs.giderosmobile.com/reference/gideros

然后例如单击左侧菜单中的Pixel:
http://docs.giderosmobile.com/reference/gideros/Pixel#Pixel

相关问题