GUI resolution - Форум Игроделов
Чт, 09 Май 2024, 00:59 
 
Приветствую Вас Гость Главная | Регистрация | Вход
Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум Игроделов » UNITY3D » СКРИПТИНГ » GUI resolution
GUI resolution
игнатДата: Сб, 30 Ноя 2013, 17:14 | Сообщение # 1
 
Сообщений: 706
Награды: 0
Репутация: 107
Статус: Offline
Вот новый вопрос: как лучше сделать "привязку" GUI элементов на экране.


Пока что остановил выбор на этом:
Код
void GuiCorector ()  {  
   ///////////////////////////////////////////////////////////////
   posX = myRect.x;  
   posY = myRect.y;  
   ///////////////////////////////////////////////////////////////
   shirina = myRect.width;  
   vysota = myRect.height;  
   ///////////////////////////////////////////////////////////////
   balansWidth = scrinWidth / Screen.width;  
   balansHeight = scrinHeight / Screen.height;  
   ///////////////////////////////////////////////////////////////
   myRect.x = posX / balansWidth;  
   myRect.y = posY / balansHeight;  
   myRect.width = shirina / balansWidth;  
   myRect.height = vysota / balansHeight;  
   ///////////////////////////////////////////////////////////////
   scrinWidth = Screen.width;  
   scrinHeight = Screen.height;  
   ///////////////////////////////////////////////////////////////
  }



Правила форума · участник GCC
 
СообщениеВот новый вопрос: как лучше сделать "привязку" GUI элементов на экране.


Пока что остановил выбор на этом:
Код
void GuiCorector ()  {  
   ///////////////////////////////////////////////////////////////
   posX = myRect.x;  
   posY = myRect.y;  
   ///////////////////////////////////////////////////////////////
   shirina = myRect.width;  
   vysota = myRect.height;  
   ///////////////////////////////////////////////////////////////
   balansWidth = scrinWidth / Screen.width;  
   balansHeight = scrinHeight / Screen.height;  
   ///////////////////////////////////////////////////////////////
   myRect.x = posX / balansWidth;  
   myRect.y = posY / balansHeight;  
   myRect.width = shirina / balansWidth;  
   myRect.height = vysota / balansHeight;  
   ///////////////////////////////////////////////////////////////
   scrinWidth = Screen.width;  
   scrinHeight = Screen.height;  
   ///////////////////////////////////////////////////////////////
  }

Автор - игнат
Дата добавления - 30 Ноя 2013 в 17:14
Форум Игроделов » UNITY3D » СКРИПТИНГ » GUI resolution
  • Страница 1 из 1
  • 1
Поиск:
Загрузка...

Game Creating CommUnity © 2009 - 2024