public override void LayoutSubviews() { int x = 0; int y = 0; int w = Frame.W; int h = Frame.H; TransparentArea.SetFrame(x, y, w, h); HiddenY = h; VisibleY = h - (h / 5 * 3); if (IsLandscape || IsLargeTablet) { w = (int)(400 * Density); VisibleY = 0; } if (!IsLandscape && IsLargeTablet) { h = Frame.W; VisibleY = Frame.H - h; } y = VisibleY; popup.Frame = new CGRect(x, y, w, h); Hide(0); }
//pomocna funkcija, racuna da li ce na poziciji x,y biti tijelo zmije protected bool WillEatBody(Vector2 position) { if (TransparentArea.InAnyArea(position)) { return(false); } foreach (var bodyPart in BodyParts) { if (position.X == bodyPart.X && position.Y == bodyPart.Y) { return(true); } } return(false); }