Jump to content

Scaling sprites from unity to Phaser using .json


rahulng
 Share

Recommended Posts

Hey guys,Ive been working on making a level editor in unity and then storing the resultant transform information like scale,position and rotation in a.json file to be read by phaser.while the position and rotation work perfectly well by changing the pivot of the sprites in unity.the scale doesnt seem to work ie the scaling in unity doesnt show the same result in phaser.if anyone has suggestion on how to calibrate it please let me know.

Link to comment
Share on other sites

unity code

 

double turret_scale_x=(turret_reference[index].transform.localScale.x-standardscale)/2;
            double turret_scale_y=(turret_reference[index].transform.localScale.y-standardscale)/2;
            if(turret_scale_x<=1)
                turret_scale_x=1;
            if(turret_scale_y<=1)
                turret_scale_y=1;

 

m.AddField("scalex",(float)turret_scale_x);
            m.AddField("scaley",(float)turret_scale_y);

 

original scale value=6.5

changed to:18.65

 

but wen i use thes same stats in phaser

using the scaleto(12,12,'turret');

 

it makes the thing HUGE,far bigger than the unity output

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...