Пример #1
0
 public SpriteNode( ITexture2D texture )
 {
     sprite = new Sprite ( texture );
     World = World2.Identity;
     tempWorld = World2.Identity;
     Alignment = SpriteAlignment.LeftTop;
 }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public GameplayScreen()
        {
            TransitionOnTime  = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            MainCharacter.Instance = new MainCharacter(this, new Vector2(0, 0));
            world1 = new World1(this);
            world2 = new World2(this);

            currentWorld = world1;
            world1.Init();
            world2.Init();
        }
Пример #3
0
            public override void Draw( GameTime gameTime )
            {
                LiqueurSystem.GraphicsDevice.RenderTarget = renderBuffer;
                LiqueurSystem.GraphicsDevice.Clear ( ClearBuffer.AllBuffer, Color.White );
                effect.SetTextures ( new TextureArgument () { Uniform = "texture", Texture = texture } );
                effect.Dispatch ( ( IEffect ef ) =>
                                 {
                    LiqueurSystem.GraphicsDevice.Draw<Vertex> ( PrimitiveType.TriangleList, vertexBuffer, indexBuffer );
                } );

                LiqueurSystem.GraphicsDevice.RenderTarget = null;
                LiqueurSystem.GraphicsDevice.Clear ( ClearBuffer.AllBuffer, new Color ( 0.2f, 0.5f, 0.4f, 1.0f ) );

                effect.SetTextures ( new TextureArgument () { Uniform = "texture", Texture = renderBuffer } );
                effect.Dispatch ( ( IEffect ef ) =>
                                 {
                    LiqueurSystem.GraphicsDevice.Draw<Vertex> ( PrimitiveType.TriangleList, vertexBuffer, indexBuffer );
                } );

                World2 world = new World2 ( LiqueurSystem.GraphicsDevice.ScreenSize / 2 - sprite.Texture.Size / 2,
                                           new Vector2 ( 1 + angle ), sprite.Texture.Size / 2, angle, sprite.Texture.Size / 2 );
                sprite.Draw ( world );

                font.DrawFont ( "Test (문자열 출력 테스트!) 日本語テスト ♣♪", Color.White, new Vector2 ( 0, 0 ) );

                base.Draw ( gameTime );
            }
Пример #4
0
 public void Draw( World2 transform )
 {
     Effect.SetTexture ( new TextureArgument () { Texture = Texture, Uniform = "texture0", Filter = TextureFilter, AnisotropicLevel = AnisotropicLevel } );
     Effect.SetArgument<Matrix4x4> ( "projectionMatrix", new OrthographicProjection (
         0, LiqueurSystem.GraphicsDevice.ScreenSize.X, LiqueurSystem.GraphicsDevice.ScreenSize.Y, 0,
         0.001f, 1000.0f
     ).Matrix );
     Effect.SetArgument<Matrix4x4> ( "worldMatrix", transform.Matrix );
     Effect.Dispatch ( RenderingSprite );
 }