Pass an image handler as fill type, is this possible is graphics 2.0?

Is that possible to pass ImageA as a fill type to ImageB? so we can do animations to ImageA, and it’s always masked by ImageB.

Hi @Jadynut Software,

I’m not sure what you mean by “animation”… do you mean, fill a vector object (or image) with an animated sprite, and have that fill animating? I don’t think that’s possible directly. You can fill another object with an image and then adjust the scale and rotation of that fill, via a transition if necessary. Not sure if that’s what you need though…

Best regards,

Brent

Hi @Brent

Yes what i want to ask is how to “fill another object with an image and then adjust the scale and rotation of that fill”.

But the sample code for image fill is like this:

object.fill = { type="image", filename="labrador.png" }  

So do you mean we can add transition animations to the fill directly like this?

transition.to( object.fill, { time=500, xScale=2, yScale=2, x=1000 } )  

Also i want to ask if the method below is possible?

local labradorHdl = display.newImageRect('labrador.png',100,100) local frameHdl = display.newImageRect('frame.png',50,50) frameHdl.fill = labradorHdl --// i know this's not correct, but if we can use a already created display object as a fill, that should be much easier than the 'labrador' sample  

Not yet. We are working on something similar, but you would have to use snapshot objects instead of just any display object.

Hi @walter,

That sounds great! thanks.

Hi @Jadynut Software,

I’m not sure what you mean by “animation”… do you mean, fill a vector object (or image) with an animated sprite, and have that fill animating? I don’t think that’s possible directly. You can fill another object with an image and then adjust the scale and rotation of that fill, via a transition if necessary. Not sure if that’s what you need though…

Best regards,

Brent

Hi @Brent

Yes what i want to ask is how to “fill another object with an image and then adjust the scale and rotation of that fill”.

But the sample code for image fill is like this:

object.fill = { type="image", filename="labrador.png" }  

So do you mean we can add transition animations to the fill directly like this?

transition.to( object.fill, { time=500, xScale=2, yScale=2, x=1000 } )  

Also i want to ask if the method below is possible?

local labradorHdl = display.newImageRect('labrador.png',100,100) local frameHdl = display.newImageRect('frame.png',50,50) frameHdl.fill = labradorHdl --// i know this's not correct, but if we can use a already created display object as a fill, that should be much easier than the 'labrador' sample  

Not yet. We are working on something similar, but you would have to use snapshot objects instead of just any display object.

Hi @walter,

That sounds great! thanks.