devilzk Posted January 29, 2014 Share Posted January 29, 2014 Hi, I am using an existing sprite sheet (generated by TexturePacker originally for a starling based project). Actual sprite canvas is bigger and contains some transparent area. However, while creating the sprite sheet in TP, "Trim" option was selected and result is a subtexture entry like below:<SubTexture name="button1" x="63" y="1171" width="60" height="110" frameX="-12" frameY="-20" frameWidth="160" frameHeight="160"/>In Phaser, I am using following code to add this button : var tab1 = new Phaser.Button(this.game, 18, 34, 'mysheet');tab1.frameName = 'button1';grp.add(tab1); //group is Phaser.group created in my game scene.My button is being added fine at the desired location. However, when I do mouseover I find that hitArea of button is off by exactly frameX and frameY value of atlas XML. So some area of button is not getting hand cursor at all while some "transparent" area near button is showing it. I tried changing value in XML for this button to 0 for both frameX and frameY and button was added at correct location. However, I feel thats not right solution, given that same assets are being used for starling project and I don't want to make manual changes. There must be something which I am missing in this process. Any clue, what I am missing? Thanks in advance Link to comment Share on other sites More sharing options...
rich Posted January 29, 2014 Share Posted January 29, 2014 Could you send me the atlas + image (and a boiled down test case) so I can check this against dev please? Link to comment Share on other sites More sharing options...
devilzk Posted January 30, 2014 Author Share Posted January 30, 2014 Sure, in next couple of hours, I will share both with you. Link to comment Share on other sites More sharing options...
Recommended Posts