Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Issue with the SourceY being different in some of the sprites
Started by vik_b_it Dec 31 2012 07:06 PM

2 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

vik_b_it

[GLOBAL: userInfoPane.html]
vik_b_it
  • Contributor

  • 243 posts
  • Corona SDK

Hi guys,

Very new to TP and am currently evaluating it at the moment. Looks like a great product.
But I am having an issue when I publish the sprite sheet..

TP creates a data file, and in the data file some of the Y values are different as shown below


 {
            -- dog_wakesup_00020
            x=600,
            y=0,
            width=200,
            height=86,

            sourceX = 82,
            sourceY = 630,
            sourceWidth = 1024,
            sourceHeight = 768
        },
        {
            -- dog_wakesup_00021
            x=200,
            y=88,
            width=200,
            height=88,

            sourceX = 82,
            sourceY = 628,
            sourceWidth = 1024,
            sourceHeight = 768
        },


As you can see the sourceY is different. If I leave the sourceX and Y in the data file, the animation looks great. But because I want to move the animation around the screen using the X and Y properties I take out the SourceX and SourceY from the file. As soon as I do this, the animation gitteres a bit.

Is there a setting I am missing I have to set up before I export? any help would be appreciated.

Thanks

Vik
uid: 67619 topic_id: 34453 reply_id: 334453


[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Vik,
Once you have the sprite on the screen, moving it around by x and y values is the same as any display object, with the x/y being (by default) the center of the sprite. When you're looking at the data TexturePacker exports, the "x" and "y" values pertain to where those frames reside on the image sheet... they aren't related to the position of the sprite on the screen once it's output as a display object. Does that clarify things a bit?

Best regards,
Brent
uid: 200026 topic_id: 34453 reply_id: 137002


[TOPIC: post.html]
#3

vik_b_it

[GLOBAL: userInfoPane.html]
vik_b_it
  • Contributor

  • 243 posts
  • Corona SDK

Brent,

so what does the SourceX and SourceY attributes do?

also the last post I did on https://developer.coronalabs.com/forum/2012/12/30/dynamic-sprite-sheets
when I try to center the sprite on the screen, it just puts it in the botton left of the screen...
Vik
uid: 67619 topic_id: 34453 reply_id: 137010



[topic_controls]
[/topic_controls]