2D Toolkit Forum
2D Toolkit => Support => Topic started by: moofly on March 13, 2015, 04:48:37 pm
-
I'm using a 2DToolkit camera and it has a wildcard override set to maintain a constant width in the scene. This works perfectly fine for most elements within the scene and overcomes many potential problems.
One of the sprites, a tree, I'd essentially like to scale so that it goes from the bottom to the top of the screen on all devices. In the past I've done this by attaching a script so that on start() (and update() inside an #ifdef UNITY_EDITOR to aid testing) the sprite was scaled, but I wondered if 2DToolkit had some clever built-in way that 2D toolkit could did this that I wasn't aware of?
Also, should I put the scaling into the Sprite component rather than the Transform component to avoid breaking the batching?
-
You can do some cheeky thing where you use 2 cameras, one that just sees the trees that is set up to fit vertical and the other one set up normally. That could work, but just scaling it needs a bit of code but is probably easier longer term :)
-
Thanks !
-
Another question - I notice in the demos that you attached the screen anchors to the camera. I've tried adding the screen anchor script to the tree gameobject as a component and it seems to work fine - is there a reason I shouldn't do it this way? I like it this way because it means my scene stays organised.
Update: I've looked through the script (not sure why I didn't do that before) and it looks fine, but if you think it isn't wise do say!