public static Vector2 GetDefaultPosition(ChatPosition position, ChatSize size) { Vector2 chatSize = GetDefaultSize(size); Vector2 margin = ChatMargins[(int)position]; bool snapRight = ((int)position & 1) == 1; bool snapTop = ((int)position & 2) == 2; float needXPos; float needYPos; if (snapRight) { needXPos = ReferenceX - margin.x - chatSize.x; } else { needXPos = margin.x; } if (snapTop) { needYPos = -margin.y; } else { needYPos = -ReferenceY + margin.y + chatSize.y; } needXPos *= Screen.width / ReferenceX; needYPos *= Screen.height / ReferenceY; return(new Vector2(needXPos, needYPos)); }
public static Vector2 GetDefaultSize(ChatSize size) { Vector2 chatSize = ChatSizes[(int)size]; chatSize.x *= Screen.width / ReferenceX; chatSize.y *= Screen.height / ReferenceY; return(chatSize); }