8
« on: January 24, 2013, 12:40:33 am »
As I was typing the below you posted, so I will reply to your post. Correct, my issue was needing to move some stuff around, but the root problem was actually my latest question which was related to my original post of not grasping all this. Once I get this root issue fixed then moving stuff around should work fine per what you already suggested on that. Per your recent post, that seems to work great. But, I dont see the option for "Pixel Perfect Fit" in the camera override, I just downloaded the current version from the asset store as well to double check it wasn't a version issue. I do see a "stretch to fit".
Below is what I was going to do before you posted your response. Looks like I dont need to set scale and do what you suggested and then separately pick which asset 2x vs. 4x to load on my own, not a problem. Thanks for all your help on this!
******************************
I think I now know how to approach this. I will at game load time, the same time I set 4x vs. 2x also create and have only 1 resolution override.
This override will be...
width = screen.width
height = screen.height
auto scale = none
scale = screen.height / NativeRes.height (see psuedo code below)
fit mode = center
While testing the above logic by manually setting these on the camera this works, everything gets positioned properly. What I'll be doing is essentially creating 1 wildcard at runtime that is actually meant for the active resolution. Of course I need to also make sure that when Im setting the scale to also set a matching 4x vs. 2x, which would have impact on the scale.
Some pseudo/hack code here on handling the decision making for 4x vs. 2x and its impact on scale to make sure the best possible scale and source is rendered.
scale = 1
tk2dSystem.CurrentPlatform = "2x"
tempScale = screen.height / 2k2dCamera.NativeRes.height
if tempScale >= 1.5
tk2dSystem.CurrentPlatform = "4x"
tempScale = screen.height / (2k2dCamera.NativeRes.height * 2)
scale = tempScale ///// here we are scaling down the 4x vs. scaling up the 2x.....need to play with the results to see what looks optimal and when (scale up/down 4x/2x)
else if templScale > 1 AND tempscale < 1.5
scale = tempScale /////scale up the 2x...but no more than 1.5 times its original
else if tempScale < 1
scale = tempScale ////scale down the 2x
//I could then also check if the scale < .5 and show a 1x vs. the native what I used to design of 2x...I doubt I will ever have a height of < 480