コード例 #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
ファイル: TitleScene.cs プロジェクト: Transwarmer/Transwarmer
        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
ファイル: Camera3D.cs プロジェクト: artron33/PsmFramework
 /// <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 );
 }