Inheritance: Graffiti.Core.Geometry.IndexedMesh
Exemplo n.º 1
0
        protected override void Initialize()
        {
            GraphicsDevice.Viewport = graphics.AdaptViewport(256, 256);

            base.Initialize();

            var halfWidth = GraphicsDevice.Viewport.Width / 2f;
            var halfHeight = GraphicsDevice.Viewport.Height / 2f;

            _renderer = Renderer.Create(
                GraphicsDevice, Features.MultiPass | Features.PreTransformed | Features.SingleChannelTexCoords,
                projection: Matrix.CreateOrthographicOffCenter(-halfWidth, halfWidth, halfHeight, -halfHeight, 0, 1));

            _quad = new Quad
            {
                Transform = (ConstantMatrix)Matrix.CreateScale(256f),
                Brush = new Brush
                {
                    new Layer
                        {
                            BlendState = BlendState.Opaque,
                            Texture = Content.Load<Texture2D>("Content/basewall01bit")
                        },
                    new Layer
                        {
                            BlendState = BlendState.Additive,
                            Texture = Content.Load<Texture2D>("Content/basewall01bitfx"),
                            Transform = new TransformGroup
                                            {
                                                new TranslateTransform
                                                    {
                                                        Keyframes = new Keyframes<Vector3>
                                                                        {
                                                                            { 0f, Vector3.Zero },
                                                                            { 1000f, new Vector3(6f, 1f, 0f) }
                                                                        },
                                                        Mode = Mode.Loop
                                                    }
                                            }
                        },
                    new Layer
                        {
                            BlendState = BlendState.NonPremultiplied,
                            Texture = Content.Load<Texture2D>("Content/basewall01bit")
                        }
                }
            };
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            GraphicsDevice.Viewport = graphics.AdaptViewport(256, 256);

            base.Initialize();

            var halfWidth = GraphicsDevice.Viewport.Width / 2f;
            var halfHeight = GraphicsDevice.Viewport.Height / 2f;

            _renderer = Renderer.Create(
                GraphicsDevice, Features.MultiPass | Features.PreTransformed | Features.SingleChannelTexCoords,
                projection: Matrix.CreateOrthographicOffCenter(-halfWidth, halfWidth, halfHeight, -halfHeight, 0, 1));

            var brush = new Brush
            {
                // Compose brushes here
            };

            _quad = new Quad
            {
                Transform = (ConstantMatrix)Matrix.CreateScale(256f),
                Brush = brush
            };
        }