예제 #1
0
        public LoadingPrimitive(Game game)
        {
            Material = GetMaterial(game);
            var verticies = GetVerticies(game);

            VertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionTexture), verticies.Length, BufferUsage.WriteOnly);
            VertexBuffer.SetData(verticies);
        }
예제 #2
0
        virtual protected VertexPositionTexture[] GetVerticies(Game game)
        {
            var dd = (float)Material.TextureWidth / 2;

            return(new[] {
                new VertexPositionTexture(new Vector3(-dd - 0.5f, +dd + 0.5f, -3), new Vector2(0, 0)),
                new VertexPositionTexture(new Vector3(+dd - 0.5f, +dd + 0.5f, -3), new Vector2(1, 0)),
                new VertexPositionTexture(new Vector3(-dd - 0.5f, -dd + 0.5f, -3), new Vector2(0, 1)),
                new VertexPositionTexture(new Vector3(+dd - 0.5f, -dd + 0.5f, -3), new Vector2(1, 1)),
            });
        }
예제 #3
0
        protected override VertexPositionTexture[] GetVerticies(Game game)
        {
            int   w = game.RenderProcess.DisplaySize.X;
            int   h = game.RenderProcess.DisplaySize.Y / 80;
            float x = -w / 2 - 0.5f;
            float y = game.RenderProcess.DisplaySize.Y / 2 - h - 0.5f;

            return(new[] {
                new VertexPositionTexture(new Vector3(x + 0, -y - 0, -1), new Vector2(0, 0)),
                new VertexPositionTexture(new Vector3(x + w, -y - 0, -1), new Vector2(1, 0)),
                new VertexPositionTexture(new Vector3(x + 0, -y - h, -1), new Vector2(0, 1)),
                new VertexPositionTexture(new Vector3(x + w, -y - h, -1), new Vector2(1, 1)),
            });
        }
예제 #4
0
        protected override VertexPositionTexture[] GetVerticies(Game game)
        {
            float w, h;

            w = Material.TextureWidth;
            h = Material.TextureHeight;
            if (w != 0 && h != 0)
            {
                var scaleX = (float)game.RenderProcess.DisplaySize.X / w;
                var scaleY = (float)game.RenderProcess.DisplaySize.Y / h;
                var scale  = scaleX < scaleY ? scaleX : scaleY;
                w = w * scale / 2;
                h = h * scale / 2;
            }
            return(new[] {
                new VertexPositionTexture(new Vector3(-w - 0.5f, +h + 0.5f, -2), new Vector2(0, 0)),
                new VertexPositionTexture(new Vector3(+w - 0.5f, +h + 0.5f, -2), new Vector2(1, 0)),
                new VertexPositionTexture(new Vector3(-w - 0.5f, -h + 0.5f, -2), new Vector2(0, 1)),
                new VertexPositionTexture(new Vector3(+w - 0.5f, -h + 0.5f, -2), new Vector2(1, 1)),
            });
        }
예제 #5
0
 virtual protected LoadingMaterial GetMaterial(Game game)
 {
     return(new LoadingMaterial(game));
 }
예제 #6
0
 protected override LoadingMaterial GetMaterial(Game game)
 {
     return(new LoadingScreenMaterial(game));
 }
예제 #7
0
 public LoadingScreenPrimitive(Game game)
     : base(game)
 {
 }
예제 #8
0
 public LoadingBarPrimitive(Game game)
     : base(game)
 {
 }
예제 #9
0
파일: UserInput.cs 프로젝트: Reve/ORTS-MG
 public static void Initialize(Game game)
 {
     inputSettings = game.Settings.Input;
     Raildriver    = new UserInputRailDriver(game);
 }
예제 #10
0
 protected virtual Texture2D GetTexture(Game game)
 {
     return(SharedTextureManager.Get(game.RenderProcess.GraphicsDevice, Path.Combine(game.ContentPath, "Loading.png")));
 }
예제 #11
0
 public LoadingMaterial(Game game)
     : base(game.GraphicsDevice)
 {
     shader  = new LoadingShader(game.RenderProcess.GraphicsDevice);
     texture = GetTexture(game);
 }