Пример #1
0
        public StaticBackground()
        {
            var texture = new Texture2D ("/Application/Assets/background/background.jpg", false);
            var textureInfo = new TextureInfo (texture);
            this.RegisterDisposeOnExit (textureInfo);
            var sprite = new SpriteUV (textureInfo);
            sprite.Quad.S = textureInfo.TextureSizef;

            AddChild (sprite);

            Camera = new Camera2D (Director.Instance.GL, Director.Instance.DrawHelpers);
            Camera.SetViewFromViewport ();
        }
Пример #2
0
        public GameOverScene()
        {
            var texture = new Texture2D ("/Application/Assets/images/dead_scene.png", false);
            var textureInfo = new TextureInfo (texture);
            RegisterDisposeOnExit (textureInfo);
            var sprite = new SpriteUV (textureInfo);
            sprite.Quad.S = textureInfo.TextureSizef;

            AddChild (sprite);

            Camera = new Camera2D (Director.Instance.GL, Director.Instance.DrawHelpers);
            Camera.SetViewFromViewport ();

            ScheduleUpdate(2);
        }
Пример #3
0
        public TitleScene()
        {
            var texture = new Texture2D("Application/Assets/images/title_image.png", false);
            var textureInfo = new TextureInfo(texture);
            this.RegisterDisposeOnExit (textureInfo);
            var sprite = new SpriteUV(){ TextureInfo = textureInfo};
            sprite.Quad.S = textureInfo.TextureSizef;

            Camera = new Camera2D (Director.Instance.GL, Director.Instance.DrawHelpers);
            Camera.SetViewFromViewport ();

            AddChild(sprite);
            ScheduleUpdate(2);

            // for test; fireWall and fireleaf_one become noise. other images are not.
            //generateFireleafSprite();
        }
Пример #4
0
 /// <summary>
 /// Creates a 3D view that max the screen bounds in pixel size (in plane z=0)
 /// Exactly match the 3D frustum. Eye distance to z=0 plane is calculated based
 /// on current Frustum.FovY value.
 /// </summary>
 public void SetViewFromViewport()
 {
     Camera2D tmp = new Camera2D( GL, m_draw_helpers );
     tmp.SetViewFromViewport();
     SetFromCamera2D( tmp );
 }