Beispiel #1
0
 public virtual void OnRender( FlatEntityShader shader )
 {
     shader.Render( Entity.Position, Size, TextureIndex );
 }
Beispiel #2
0
        public override void OnEnter(bool firstTime)
        {
            base.OnEnter(firstTime);

            if (firstTime) {
                Generator = new CityGenerator();

                World = Generator.Generate(WorldSize, WorldSize);

                _fpsText = new UILabel(PixelFont.Large);
                _fpsText.Colour = Color4.White;
                AddChild(_fpsText);

                _posText = new UILabel(PixelFont.Large);
                _posText.Colour = Color4.White;
                AddChild(_posText);

                _infDisplay = new UIInfectionDisplay(World);
                AddChild(_infDisplay);

                PositionUI();

                Camera = new OrthoCamera(Width, Height, 4.0f / _upScale);
                Camera.SetWrapSize(WorldSize, WorldSize);
                Camera.Position2D = new Vector2(WorldSize, WorldSize) / 2.0f;
                Camera.Pitch = TargetCameraPitch;
                Camera.Yaw = TargetCameraYaw;

                Plugin.CityGenerated();

                GeoShader = new GeometryShader();
                GeoShader.Camera = Camera;

                FlatEntShader = new FlatEntityShader();
                FlatEntShader.Camera = Camera;

                ModelEntShader = new ModelEntityShader();
                ModelEntShader.Camera = Camera;

                _traceShader = new DebugTraceShader();
                _traceShader.Camera = Camera;

                _frameTimer.Start();
            }
        }