Setting the scale of an image fill of ShapeObject seems to have no effect.

Hello Everyone,

I am having some problems while setting the scale of fill images on ShapeObjects.

The object is created if a simple display.newRect and then the fill is set by using the obj.fill = { type = “image”, filename = “image.png” }

The fill image is created and applied correctly. After being applied I can set the position and use transitions to animate it, but it seems that changing either fill.scaleY or fill.scaleX has no effect on the final object.

Does this issue occur in the Corona Simulator too or only on WP8?

I ask because this will help us isolate whether or not this is a core Corona rendering issue on all platforms or a WP8 Direct3D issue on our end.

Oh sorry, forgot to mention that. This seems to be an issue with WP8 only.

Would you mind doing a quick test for me?  I think you *might* be able to work-around this by doing the following…

 -- Change the fill scale as usual. obj.fill.scaleX = yourNewScale -- Trick the rendering system into flagging this object to be re-rendered. local lastX = obj.x obj.x = lastX + 1 -- Move the object. obj.x = lastX -- Move the object back to its old position.

So, I tried changing the position of the object but it didn’t work.

I did some other tests, trying to set the position inside a timer (so it would happen on a different frame) and still nothing. Last thing i tried was use the object in a transition, but it still didn’t work.

Well, bummer.  It sounds like something is wrong with the Direct3D implementation.  I’ll add this to our queue.

I don’t have an ETA when we can get to this yet.  If you absolutely have to get by this now, then I’m afraid your only option is to scale the actual object and mask it.  Using a mask in this case is kind of wasteful, but I can’t think of any other work-around at the moment.

Tapps,

I just tested the fill scale and rotation on WP8 and it’s working for me.  I tested with sample project “Graphics-Premium\Shape” that is included with the Corona Simulator which scales and rotates the fill image within a rounded rect over time.  I even modified to scale the image over time which worked as well.  I’m curious as to what’s different in your project.  I think something else must be causing your issue.  Can you give me a some test code that I can use to reproduce this issue please?  Thanks.

Hey Joshoua,

I ran the same sample project and the shape that uses the “aquarium” image as fill is not displaying correctly. I am doing this tests using the WP8.1 emulator from Visual Studio, until our test devices arrive. Could this be the source of the error (running on the emulator instead of a physical device) ?

If I’m building for WP8, it should run correctly on both 8.0 and 8.1 devices, right ?

Attaching a screenshot of what I get from running the sample code in the emulator:

FillImage.png

I tested this sample app in my WP8 emulator and on a Lumia 920.  It worked on both.

Are you running Windows within a virtual machine?

If so, then perhaps you’re running into a virtual machine rendering bug.  Especially since the WP8 emulator is really a Microsoft Hyper-V virtual machine and that would mean running a virtual machine within a virtual machine, which I can’t get to work when I’ve tried it.

Hmm, I’m not using virtualization to run Windows. I’ll run some more tests once we have some devices to see if the problem persists, it may be a problem on my emulator only (for whatever reason…).

Hmm… maybe this is a Hyper-V issue with your video card and drivers?

I’m really not sure what else it could be.

So you see any graphics glitches when running the other built-in apps in the WP8 emulator?

Ok, so a quick update.

I ran some tests on the test device (using a Lumia 520 for now) and it’s working. You are probably right that it is a problem only with my PC’s video card, but I still haven’t updated or tried to fix it in the simulator yet.

Thanks for the help!

Thanks for the update.

Yeah, I certainly hope it’s just an emulator issue.  I did post a question to Microsoft to see if they’ve heard of anything similar, but it’ll take a while until I get a response.

In any case, I’m glad you got things going now.  I hope the rest of your WP8 app development goes well.  I’m here to support you guys, so, don’t be shy.  :slight_smile:

I am using the code from the PattenFill demo.

When I run it on normal corona simulator it scales for each device.

If i run it in the WP8 simulator the water is huge and does not scale.

Larry

I finally deployed to the device, it looks ok there, but win8 simulator looks awuful, the water does not scale.

Larry

I haven’t heard of any issues like this on real WP8 devices.

So, like I said up above, I’m hoping this is just an emulator issue with some video drivers and that it’s nothing to worry about.

To confirm, I’ve asked Microsoft’s support team if they’ve heard of anything like this.

But thanks for confirming that its working on your devices as well.

Sounds Good, Use the patterFill code, just drop it into a new Win8 project folder… thats basically what I did for my water effect.

The water is the only thing that is not scaling in simulator.

Larry

Does this issue occur in the Corona Simulator too or only on WP8?

I ask because this will help us isolate whether or not this is a core Corona rendering issue on all platforms or a WP8 Direct3D issue on our end.

Oh sorry, forgot to mention that. This seems to be an issue with WP8 only.

Would you mind doing a quick test for me?  I think you *might* be able to work-around this by doing the following…

 -- Change the fill scale as usual. obj.fill.scaleX = yourNewScale -- Trick the rendering system into flagging this object to be re-rendered. local lastX = obj.x obj.x = lastX + 1 -- Move the object. obj.x = lastX -- Move the object back to its old position.