Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Weird composite fill error
Started by jacques1 Feb 27 2014 11:18 PM

No replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 327 posts
  • Corona SDK

(edit: my bad, somehow the 1_1.png file got saved in the wrong format but still with a .png extension. i'm leaving this post here just in case someone has the same issue, so double check you saved your image files correctly ;)


Using build .2161I'm not quite sure why I'm getting the following error on device but not in the simulator:


    ?:0: attempt to index field 'fill' (a string value)
    stack traceback:
The moment it goes to the   -- cardImg.fill.effect = "composite.difference" -- line i get the above error.
Based on the following code:
    local compositePaint = {type="composite",
           paint1={ type="image", filename="1_1.png"},
           paint2={ type="image", filename="m.png"}
    local cardImg = display.newRoundedRect(0, 0, 256, 512,8 )
    cardImg.fill = compositePaint
    cardImg.fill.effect = "composite.difference"
I tried difference composite effects but all return a field 'fill' (a string value)????
I also tried with standard newRect instead of newRoundedRect but still get the same error.
Both images used to make the composite paint are 256x512 images.
Anyone run into the same issue?