Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void PlaceButtons(int p, int count, int firstPos, int screenPos)
- {
- int sec = p;
- for (int i = p; i < p + count; i = sec)
- {
- teta = (360 * (i + firstPos)) / screenPos; // screenPos = number of screen positions
- radTeta = teta * Math.PI / 180; // Converts 'Teta' to radians
- posX = (width / 2) + ((d / 2) * Math.Sin(radTeta)) - buttonRadius / 2; // X Axis positioning
- posY = (height / proportion) - ((d / 2) * Math.Cos(radTeta)) - buttonRadius / 2; // Y Axis positioning
- view = absl.Children[i]; // View definition
- rect = new Rectangle(posX, posY, buttonRadius, buttonRadius * 1.2); // New Rectangle using previous vars
- AbsoluteLayout.SetLayoutBounds(view, rect); // Finally use AbsoluteLayout to place elements in it's right place
- sec = sec + 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement