Author Topic: Trying to reposition clipping after going into fullscreen, no luck...  (Read 1784 times)

pretender

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Hi!

I have a draggable panel that goes from top to bottom of the screen. I have a script that adjusts clipping properly based on Screen.height. Here is the code:

  1. int maxHeight = GameObject.Find("UI Root (2D)").GetComponent<UIRoot>().maximumHeight;
  2.                
  3.                 Vector4 tmp = this.GetComponent<UIPanel>().clipRange;
  4.                
  5.                 if(Screen.height > maxHeight)
  6.                         tmp = new Vector4(0,0,0,maxHeight);
  7.                 else
  8.                         tmp = new Vector4(0,0,0,Screen.height);
  9.                
  10.                 this.GetComponent<UIPanel>().clipRange = tmp;
  11.                 this.GetComponent<UIDraggablePanel>().ResetPosition(); 

I attach this to any draggablepanel object that i want clipping to be from top to bottom and it works.
The problem is that when going fullscreen, this code will not work any more! I tried everything i could think of, but basically
calling this code after app is in fullscreen does not again correctly position clipping.

Is there any ideas that i can try, i waited few frames until app goes into fullscreen and then tried to position again. I really can't figure this out, any help appreciated!

pretender

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Re: Trying to reposition clipping after going into fullscreen, no luck...
« Reply #1 on: January 18, 2013, 06:17:46 AM »
Any ideas in how to reposition clipping properly after going into fullscreen?
i really need this!

thank you!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trying to reposition clipping after going into fullscreen, no luck...
« Reply #2 on: January 19, 2013, 01:58:26 AM »
Full screen or not full screen, it's exactly the same thing. Does it work if you manually resize the game window during play mode?