Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Setting the scale of an image fill of ShapeObject seems to have no effect.
Started by Tapps - enterprise Jul 18 2014 12:01 PM

17 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

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.



[TOPIC: post.html]
#2

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#3

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

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



[TOPIC: post.html]
#4

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#5

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

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.



[TOPIC: post.html]
#6

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#7

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#8

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

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



[TOPIC: post.html]
#9

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#10

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

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...).



[TOPIC: post.html]
#11

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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?



[TOPIC: post.html]
#12

Tapps - enterprise

[GLOBAL: userInfoPane.html]
Tapps - enterprise
  • Enthusiast

  • 75 posts
  • Corona SDK

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!



[TOPIC: post.html]
#13

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.  :)



[TOPIC: post.html]
#14

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

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



[TOPIC: post.html]
#15

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

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

 

Larry



[TOPIC: post.html]
#16

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#17

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

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



[TOPIC: post.html]
#18

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Everyone,

 

We've recently discovered a bug in Microsoft's C++ compiler for x86 builds (not ARM builds) that *could* have randomly caused this specific issue.  Meaning that this issue might not be a video driver issue.  Microsoft's C++ compiler was not compiling the code to do what we've coded it do.  We've worked-around the compiler issue in daily build #2643, which is available today.  If you guys can give it a go and let us know if it works-around the image fill problem you were seeing in your WP8 emulator, then that would be much appreciated.




[topic_controls]
[/topic_controls]