Blends and Composite Fills in Graphics 2.0

Im trying to test out first taking a picture and save it to system.TemporaryDirectory == this works fine

and the try to use it in a comp blend == not ok, I get this error code:

“Attempt to concatenate upvalue ‘baseDir’ (a userdata value)”

Heres the chunk that goes wrong:

local baseDir = system.TemporaryDirectory

–The image in temp dir = “image01.jpg”

–Further down in the code:

compositePaint =
  {
     type=“composite”,
     paint1 = { type=“image”, filename = baseDir … “image01.jpg” },
     paint2 = { type=“image”, filename = “texture3.jpg” }
  }

When trying this code;

  1. click first on the button start screen (it fires up the camera and saves it to the baseDir)

  2. click the button over to start the blending show

Download the attached file and try it out:

PS!

You have to use Version 2013.2026 (2013.07.15) for this to work

Hi @Hendrix000007,

I brought this to the attention of the engineers to investigate.

Thanks,

Brent

Still not working :frowning:

Please look into this fast guys

Actually, this is a syntax error in your code :stuck_out_tongue_winking_eye:

‘system.TemporaryDirectory’ is not a string, so you cannot concatenate this. This was true even in the 1.0 engine. Instead, you would use a file tables similar to what’s used in other APIs. Specifically, two properties (baseDir and filename) as shown below:

[lua]

compositePaint =
  {
     type=“composite”,
     paint1 = { type=“image”, baseDir=system.TemporaryDirectory, filename = “image01.jpg” },

     paint2 = { type=“image”, filename = “texture3.jpg” }
  }

[/lua]

When I use that, I no longer see your error message.

I still get error:

Line: 49

Attempt to index field ‘fill’ (a string value)

Can you post the code you fixed so we all can test ?

Thanx for helping out Walter :slight_smile:

Did you really get this to work with images in the temp dir ?

I have really tried with everything I can think of and tried different builds to but the same result arises with the object.fill that complains about the string error :frowning:

Attached

Hi Walter

Testing in build 2013.2036

This throws back the error I mentioned earlier:

WARNING: Failed to find image(image1.png) -->>this file do exist in the temp folder (sandboxed)
2013-11-06 01:35:24.383 Corona Simulator[2894:707] Runtime error
/Users/henrikruud/Desktop/test/startUp.lua:49: attempt to index field ‘fill’ (a string value)
stack traceback:
[C]: ?
/Users/henrikruud/Desktop/test/startUp.lua:49: in function ‘_listener’

Wich build are u testing the code in?

Any answer on this issue This does not work, I have tried what you said but no luck

This issue is moved to

Corona Labs Forums  / Corona SDK  / Advanced Graphics…

Go there now…

Hi @Hendrix000007,

I brought this to the attention of the engineers to investigate.

Thanks,

Brent

Still not working :frowning:

Please look into this fast guys

Actually, this is a syntax error in your code :stuck_out_tongue_winking_eye:

‘system.TemporaryDirectory’ is not a string, so you cannot concatenate this. This was true even in the 1.0 engine. Instead, you would use a file tables similar to what’s used in other APIs. Specifically, two properties (baseDir and filename) as shown below:

[lua]

compositePaint =
  {
     type=“composite”,
     paint1 = { type=“image”, baseDir=system.TemporaryDirectory, filename = “image01.jpg” },

     paint2 = { type=“image”, filename = “texture3.jpg” }
  }

[/lua]

When I use that, I no longer see your error message.

I still get error:

Line: 49

Attempt to index field ‘fill’ (a string value)

Can you post the code you fixed so we all can test ?

Thanx for helping out Walter :slight_smile:

Did you really get this to work with images in the temp dir ?

I have really tried with everything I can think of and tried different builds to but the same result arises with the object.fill that complains about the string error :frowning:

Attached

Hi Walter

Testing in build 2013.2036

This throws back the error I mentioned earlier:

WARNING: Failed to find image(image1.png) -->>this file do exist in the temp folder (sandboxed)
2013-11-06 01:35:24.383 Corona Simulator[2894:707] Runtime error
/Users/henrikruud/Desktop/test/startUp.lua:49: attempt to index field ‘fill’ (a string value)
stack traceback:
[C]: ?
/Users/henrikruud/Desktop/test/startUp.lua:49: in function ‘_listener’

Wich build are u testing the code in?

Any answer on this issue This does not work, I have tried what you said but no luck

This issue is moved to

Corona Labs Forums  / Corona SDK  / Advanced Graphics…

Go there now…