Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Trim function stopped working?
Started by Juf Jannie Jan 05 2015 01:21 AM

9 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

Juf Jannie

[GLOBAL: userInfoPane.html]
Juf Jannie
  • Contributor

  • 327 posts
  • Corona SDK

Does the trim function still work for you? When I use trim it scales the image to fill the removed space.
It used to work, but it seems that the last few updates broke some things in Corona?

 

Also animations made with trim on are very jittery.



[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @Juf Jannie,

Are you referring to the last few updates of Corona, or the last few updates of TexturePacker? Are you sure you're using the correct trim mode? There are two trim modes if I recall (perhaps 3). I don't think there is anything that changed in the latest few versions of Corona which would affect this.

 

Take care,

Brent



[TOPIC: post.html]
#3

Juf Jannie

[GLOBAL: userInfoPane.html]
Juf Jannie
  • Contributor

  • 327 posts
  • Corona SDK

Latest version of texture packer.
I reinstalled an older version I had, and found some settings, that should help with the jittering.

But I think the scale problem has to do with a combination of things.

I am using spine that creates animations, but the spine engine is being driven by spine helper someone on these forums wrote.
 

So somewhere along the line it goes wrong. But, I solved by reexporting the files from photoshop so they didn't need trimming. Bit f a work around. But too many steps from different people where there can be a problem. So I chose a workaround.

 

There is just one trimmed the other two are clipping modes or something,they don't store the original size of the image.



[TOPIC: post.html]
#4

Playtypus

[GLOBAL: userInfoPane.html]
Playtypus
  • Observer

  • 16 posts
  • Corona SDK

Hi Juf Jannie,
 
I found the same issue in my last project. And I am fighting against it in my current project. 
My solution is to use "display.newImage" instead of "display.newImageRect" ( I don't know why, but newImage scales properly images from imageSheet and newImageRect doesn't ).
After you can scale images with .xScale and .yScale properties.
 
Would be nice that corona team solves it.
 
Have a nice day, thanks for your contributions Juf and Brend (I learned from them in the past)
 
Adrian


[TOPIC: post.html]
#5

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

Just adding my voice - i have also been struggling with some issue using display.newImageRect() It looks great in the simulator, but fails on device...  Going to try your approach aramirez64



[TOPIC: post.html]
#6

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

Still no joy. Nothing I do seems to allow image to come up on the device (and the app stops at that point). Stuff before it loads, but nothing at that point... It all works great on the simulator. Are there any tools that allow you to see errors on the device?

[TOPIC: post.html]
#7

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @sonyayllc,

What overall size (pixel dimensions) is your image sheet? What device are you testing on?

 

Best regards,

Brent



[TOPIC: post.html]
#8

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

It is just a single image, about 260w x 190h. There is some code to switch the image based on button selection, but they are separate images.

I am using a Galaxy S5, and now that you mention it, I am not sure why I didn't try another device.

[TOPIC: post.html]
#9

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Are you obeying case-sensitive rules? Devices are adamant about that, while the Simulator is not. Please check that you have typed the image name in your code to exactly match the case-sensitive name of the image file.

 

Brent



[TOPIC: post.html]
#10

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

That was it, thanks Brent! A new tool was putting the file extension in all CAPS.

Thanks again!


[topic_controls]
[/topic_controls]