Hello Guest

Author Topic: Resolution  (Read 3190 times)

wagenheimer

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Resolution
« on: November 21, 2014, 08:04:29 pm »
I do use Fit Height to all my cameras and it works very well...

But... I want that if the Aspectio Ratio is lower than 1,33, instead of using Fit Height it keeps the 1,33 aspect ratio and then scale to fit the screen... How can I achieve this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Resolution
« Reply #1 on: November 22, 2014, 11:03:55 am »
tk2d doesn't support that, but you can control the tk2d camera override from code. So... if you create a behaviour that can decide what to do based on resolution, you just need a tk2dcamera with exactly one wildcard override, and set it up from code as you need it.

wagenheimer

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: Resolution
« Reply #2 on: November 24, 2014, 02:14:16 pm »
How to create this behavior? I have some ideas of how to calculate the desired scale but how to change it on runtime?


wagenheimer

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: Resolution
« Reply #3 on: November 24, 2014, 02:58:07 pm »
It worked but I had to change tk2dCamera.cs code.

It would be possible if a future update add this option?

FitHeightorScaleToFit

And add two Addittional Properties : MinWidth and MaxWidth bounds.

It tries to Fit Height, but if it not fits using Min/Max bounds, so it will Scale It using the Min/Max bounds configuration.

I'm sure this will be usefully to tons of people here! =)




unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Resolution
« Reply #4 on: November 28, 2014, 12:31:50 pm »
Not that it matters now that you have a solution, but you can do this without touching tk2d code at all, you can get the tk2dCamera.CurrentResolutionOverride and do what you wish with it externally.