Hello Guest

Author Topic: Full Screen and TK2D Camera  (Read 7573 times)

wubak

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Full Screen and TK2D Camera
« on: August 29, 2012, 10:09:43 pm »
Hi,

I'm trying to wrap my head around the interaction between the TK2D Camera and fullscreen setting (i.e. in the webplayer or by unchecking the "windowed" checkbox in a standalone app).

Is it possible to provide a resolution override that will kick in when the user selects fullscreen so that the image isn't improperly scaled?

Thanks for any help with this!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #1 on: August 29, 2012, 10:41:30 pm »
The tk2dCamera gets the resolution from the camera, so it should work scaling to full screen. What sort of issues were you having?

wubak

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #2 on: August 30, 2012, 01:09:38 am »
I'm not having an issue yet per se... just trying to figure out what target resolution to use as my default.

So, what happens if the aspect ratio of the resolution I've been working with doesn't match the user's fullscreen AR?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #3 on: August 30, 2012, 10:19:37 am »
It will always make the display pixel perfect (based on the resolution). So if you switch to a full screen wide res, then by default everything will hug the bottom left and be made pixel perfect. If you use anchors, the anchors will reposition themselves to the new resolution.

wubak

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #4 on: August 30, 2012, 06:19:16 pm »
Ok. So, let's say I have a 700x700 sprite background image that's anchored at the bottom left. This is a 1:1 aspect ratio.

If I send this to fullscreen on a 16:10 1680x1050 display, what do you expect to happen?

A) The image is stretched to fill the screen - distorting its appearance
B) The image stays in its native resolution, hugging the bottom left, leaving open space to the top and right
C) The image is scaled up as much as possible within the screen bounds without cropping, keeping its native aspect ratio but leaving open space to the right.

I guess on some level I'm trying to figure out exactly what you mean by pixel perfect:) Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #5 on: August 30, 2012, 06:57:00 pm »
The answer it is it depends on how you have your tk2dCamera set up.

By default with a newly created tk2dCamera, the sprite will always be pixel perfect, so the answer will be B. The 700x700 pixel sprite will occupy exactly 700x700 pixels on screen regardless of resolution.
You have options on how to treat this by setting up overrides in the tk2dCamera.

You set up a "native" resolution in the tk2dCamera. This is the base resolution all overrides are worked out from.
You can set up an override to scale up to fit the view (i.e. 700x700 will be displayed at the same ratio compared to the native resolution)
You can also set different overrides per target resolution, so you could say that the image is scaled up 2x on 1680x1050, and so on.

Hope that helps.

wubak

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #6 on: August 31, 2012, 07:08:10 am »
I see.

So, if I want to provide a fullscreen option, I need to anticipate and provide overrides for all potential resolutions?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #7 on: August 31, 2012, 08:01:36 am »
No, I should have made it clear. There's a wildcard option which lets you perform scaling on a group of resolutions.

wubak

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Full Screen and TK2D Camera
« Reply #8 on: August 31, 2012, 10:45:12 pm »
Ah, this is great! I hadn't actually tried adding an override yet. That's what I get for trying to think it all through before acting! Thanks.