Ejemplo n.º 1
0
        public void Render()
        {
            if (renderable == null)
            {
                return;
            }

            if (self.Height > 0)
            {
                renderable.SetPosition(self.GraphicPositionWithoutHeight + info.Offset);
                renderable.SetColor(Color.Shadow);
                renderable.Render();
            }

            renderable.SetPosition(self.GraphicPosition + info.Offset);
            renderable.SetColor(cachedColor);
            renderable.Render();
        }
Ejemplo n.º 2
0
        public Terrain(World world, MPos position, TerrainType type)
        {
            this.world = world;
            Position   = position;
            Type       = type;

            renderable = new StaticBatchRenderable(Position.ToCPos(), VAngle.Zero, type.Texture);
            if (type.Overlay != null)
            {
                overlay = new BatchSequence(type.Overlay, startRandom: true);
                overlay.SetPosition(Position.ToCPos());
            }
            edges   = new StaticBatchRenderable[4];
            corners = new StaticBatchRenderable[4];
        }