簡體   English   中英

OpenGL ES 2.0的幾個場景

[英]OpenGL ES 2.0 several scenes

如何在使用opengl的多個場景之間實現過渡?

我有2個不同的場景。 每個都創建其框架並渲染緩沖區並將其綁定。 但是,然后我嘗試在這些場景之間切換-什么也沒有發生...我嘗試在切換時刪除所有緩沖區,但這是行不通的。 第一個場景仍然可見。

好吧,以我的經驗,您可能需要處理第一個場景的視覺效果的紋理。 一個簡單的想法是使用psm studio的OpenGLES方法。

public TitleScene ()
{
  this.Camera.SetViewFromViewport();
  _texture = new Texture2D("Application/images/title.png",false);
  _ti = new TextureInfo(_texture);
  SpriteUV titleScreen = new SpriteUV(_ti);
  titleScreen.Scale = _ti.TextureSizef;
  titleScreen.Pivot = new Vector2(0.5f,0.5f);
  titleScreen.Position = new Vector2(Director.Instance.GL.Context.GetViewport().Width/2,
      Director.Instance.GL.Context.GetViewport().Height/2);
  this.AddChild(titleScreen);
  public override void Update (float dt)
  {
    base.Update (dt);
    var touches = Touch.GetData(0).ToArray();
    if((touches.Length >0 && touches[0].Status == TouchStatus.Down) || Input2.GamePad0.Cross.Press)
    {
      Director.Instance.ReplaceScene(new MenuScene());
    }
  }

  ~TitleScene()
  {
    _texture.Dispose();
    _ti.Dispose ();
  }
}

希望這會對您所缺少的內容有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM