コード例 #1
0
ファイル: Benchmark.cs プロジェクト: matyasf/sparrow-sharp
        private void AddTestObjects(int numObjects)
        {
            const int border = 40;

            Random r = new Random();

            for (int i = 0; i < numObjects; ++i)
            {
                Quad egg = new Quad();
                egg.Texture = textures[1];
                egg.Width   = textures[1].Width;
                egg.Height  = textures[1].Height;
                egg.AlignPivot(HAlign.Center, VAlign.Center);
                egg.X        = r.Next(border, (int)Stage.StageWidth - border);
                egg.Y        = r.Next(border, (int)Stage.StageHeight - border);
                egg.Rotation = (float)(r.Next(0, 100) / 100.0f * Math.PI);
                _container.AddChild(egg);
            }
        }