【问题标题】:How to use getPixel, getColor Method in lua如何在lua中使用getPixel、getColor方法
【发布时间】:2018-04-27 14:50:28
【问题描述】:

谁能告诉我在 lua 中使用 getPixel 和 getColor 的正确方法。 我试过了

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

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

...我就是不知道 lua 在抱怨什么。

错误尝试调用全局“getPixel”(一个零值)

【问题讨论】:

    标签: lua gideros


    【解决方案1】:

    有人可以告诉我使用 getPixel 的正确方法吗? 在 lua 中获取颜色。

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

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

    ...我就是不知道 lua 在抱怨什么。

    错误:尝试调用全局“getPixel”(一个零值)

    Lua 抱怨你调用了一个 nil 值。您的全局环境中没有名为 getPixel 的变量。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-10
      • 2017-03-23
      相关资源
      最近更新 更多