Exemple #1
0
        public override void Draw(RenderWindow window)
        {
            TextureObjects.Clear();

            int drawPoint = -20;

            while (drawPoint < window.Size.X)
            {
                floorSprite.Position = new Vector2f(drawPoint, window.Size.Y - 90);

                TextureObjects.Add(new Sprite(floorSprite));

                window.Draw(floorSprite);

                drawPoint += (int)floorSprite.Texture.Size.X - 20;
            }

            platformTexture.Position = new Vector2f(0, window.Size.Y - 350); // first left.

            TextureObjects.Add(new Sprite(platformTexture));

            window.Draw(platformTexture);

            platformTexture.Position = new Vector2f(0, window.Size.Y - 600); // second left.

            TextureObjects.Add(new Sprite(platformTexture));

            window.Draw(platformTexture);

            platformTexture.Position = new Vector2f(platformTexture.Texture.Size.X + 35, window.Size.Y - 800); // third left.

            TextureObjects.Add(new Sprite(platformTexture));

            window.Draw(platformTexture);

            platformTextureRev.Position = new Vector2f(window.Size.X - platformTexture.Texture.Size.X, window.Size.Y - 350); // first right.

            TextureObjects.Add(new Sprite(platformTextureRev));

            window.Draw(platformTextureRev);

            platformTextureRev.Position = new Vector2f(window.Size.X - platformTexture.Texture.Size.X, window.Size.Y - 600); // second right.

            TextureObjects.Add(new Sprite(platformTextureRev));

            window.Draw(platformTextureRev);

            platformTextureRev.Position = new Vector2f(window.Size.X - platformTexture.Texture.Size.X * 2 - 35, window.Size.Y - 800); // third right.

            TextureObjects.Add(new Sprite(platformTextureRev));

            window.Draw(platformTextureRev);

            base.Draw(window);
        }
Exemple #2
0
        public override void Draw(RenderWindow window)
        {
            TextureObjects.Clear();

            platformTexture.Position = new Vector2f(0, window.Size.Y - 150); // first left.

            TextureObjects.Add(new Sprite(platformTexture));

            window.Draw(platformTexture);

            platform2Texture.Position = new Vector2f(500, window.Size.Y - 350); // second left.

            TextureObjects.Add(new Sprite(platform2Texture));

            window.Draw(platform2Texture);

            platformTexture.Position = new Vector2f(0, window.Size.Y - 610); // third left.

            TextureObjects.Add(new Sprite(platformTexture));

            window.Draw(platformTexture);

            platformTextureRev.Position = new Vector2f(window.Size.X - platformTexture.Texture.Size.X, window.Size.Y - 150); // first right.

            TextureObjects.Add(new Sprite(platformTextureRev));

            window.Draw(platformTextureRev);

            platform2TextureRev.Position = new Vector2f(window.Size.X - platformTexture.Texture.Size.X - 500, window.Size.Y - 350); // second right.

            TextureObjects.Add(new Sprite(platform2TextureRev));

            window.Draw(platform2TextureRev);

            platformTextureRev.Position = new Vector2f(window.Size.X - platformTexture.Texture.Size.X, window.Size.Y - 610); // third right.

            TextureObjects.Add(new Sprite(platformTextureRev));

            window.Draw(platformTextureRev);

            base.Draw(window);
        }
Exemple #3
0
        private void RightPanelAddTextureObject(object sender, RoutedEventArgs e)
        {
            OpenFileDialog myDialog = new OpenFileDialog();

            myDialog.Filter          = "Картинки(*.JPG;*.GIF;*.PNG)|*.JPG;*.GIF;*.PNG" + "|Все файлы (*.*)|*.* ";
            myDialog.CheckFileExists = true;
            myDialog.Multiselect     = true;
            if (myDialog.ShowDialog() == true)
            {
                foreach (string fiilename in myDialog.FileNames)
                {
                    TextureObject texobj = new TextureObject();
                    texobj.ImagePath = new Uri(fiilename, UriKind.Absolute);
                    if (texobj.ImagePath.IsFile)
                    {
                        texobj.Name = System.IO.Path.GetFileNameWithoutExtension(texobj.ImagePath.LocalPath);
                    }
                    TextureObjects.Add(texobj);
                }
            }
        }