Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PDZ

Pages: [1]
1
In tk2dCamera.cs, these lines reposition the camera after scaling:

Code: [Select]
if (currentResolutionOverride.autoScaleMode != tk2dCameraResolutionOverride.AutoScaleMode.StretchToFit)
{
switch (currentResolutionOverride.fitMode)
{
case tk2dCameraResolutionOverride.FitMode.Center:
offset = new Vector2(Mathf.Round((settings.nativeResolutionWidth  * scale.x - pixelWidth ) / 2.0f),
Mathf.Round((settings.nativeResolutionHeight * scale.y - pixelHeight) / 2.0f));
break;

default:
case tk2dCameraResolutionOverride.FitMode.Constant:
offset = -currentResolutionOverride.offsetPixels; break;
}
}

You can disable the re-entering vertically if you like, or simply add another fit mode to do this for you.

Cool, thanks for the reply!

2
Hey,

I am using the Override function 'Fit Width', which means when I run at a higher resolution there are strips along the top and the bottom of the screen. How might I position my camera programmatically so that there is no strip along the bottom and it is all at the top of the screen?

The difference in y resolution between my native (640) and the target resolution I am testing against (768) is 128. However seeing it in the editor I need to move my camera 40 pixels up on the Y to hide the bottom strip. What is the math I need to be using? Finding the difference between the target and the native resolutions doesn't seem to be the solution.

Thanks in advance.

Pages: [1]