Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. public void PlaceButtons(int p, int count, int firstPos, int screenPos)
  2.         {
  3.             int sec = p;
  4.             for (int i = p; i < p + count; i = sec)
  5.             {
  6.                 teta = (360 * (i + firstPos)) / screenPos; // screenPos = number of screen positions
  7.                 radTeta = teta * Math.PI / 180; // Converts 'Teta' to radians
  8.                 posX = (width / 2) + ((d / 2) * Math.Sin(radTeta)) - buttonRadius / 2; // X Axis positioning
  9.                 posY = (height / proportion) - ((d / 2) * Math.Cos(radTeta)) - buttonRadius / 2; // Y Axis positioning
  10.  
  11.                 view = absl.Children[i]; // View definition
  12.                 rect = new Rectangle(posX, posY, buttonRadius, buttonRadius * 1.2); // New Rectangle using previous vars
  13.                 AbsoluteLayout.SetLayoutBounds(view, rect); // Finally use AbsoluteLayout to place elements in it's right place
  14.                 sec = sec + 1;
  15.             }
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement