Hello Guest

Author Topic: 2dtk + Vectrosity (UnityUI) - Scaling  (Read 4214 times)

appymedia

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
2dtk + Vectrosity (UnityUI) - Scaling
« on: November 24, 2015, 04:59:07 pm »
Hi All,

I'm using 2dtk with a 2dtk camera that has an override set to 'closest multiple of two' which works great for retro 'pixely' type stuff.  I'm also just starting to use the gold standard line drawing asset 'Vectrosity'.  Line drawing takes place using a UnityUI canvas in Screen Space Overlay mode.  Vectrosity only allows the Screen Space Overlay mode.  I see I can use the Canvas Scaler component and emulate 'Fit Width' and 'Fit Height' to match up to the same overrides the 2dtk Camera has but what about 'closest multiple of two' so I can maintain the same scale for both game and UI in general?  Any ideas?  Please bear in mind I started to learn Unity a while ago but had to stop because life got in the way and I'm only recently getting going again so my understand might be wrong of how I'm approaching this!

Thanks all, really applicate any help I can get.

Regards

appymedia

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: 2dtk + Vectrosity (UnityUI) - Scaling
« Reply #1 on: November 26, 2015, 12:08:10 am »
Hi Folks,

Spent some time and compromised by setting the canvas mode to 'world' and then adjusting the canvas size to match up with the 2dTK camera.  I lose the ability to add/edit lines in the Unity editor but for now that's not an issue for what I'm after.  Since the lines are part of the game world I wanted to use the same co-ord system which this seems to allow.  In fact this allows to make a Unity UI in general scale using the 2dTK scaling as well which I've been wondering how to do as well.

All I did was set the canvas rect transfrom position to the same pos as the 2dTK camera, set Z to something higher than the 2dTK camera Z and width and height to the 2dTK screen extent width and height.  Be interested to hear if anybody else does this kind of thing and how they have approached, cheers.

Pete