【问题标题】:How to change the color of an image in XNA如何在 XNA 中更改图像的颜色
【发布时间】:2012-07-23 10:55:17
【问题描述】:

我有一个包含半透明白色图像的 Texture2D...我想知道如何以编程方式将其更改为半透明绿色。

任何帮助将不胜感激。 j3d

【问题讨论】:

    标签: c# .net xna


    【解决方案1】:

    当你draw它时,你可以指定颜色:

    batch.Draw(texture, Vector2.Zero, Color.Green);
    

    【讨论】:

      【解决方案2】:

      关于:

      batch.Draw(texture, myVector, Color.Green * 0.5f); //The float indicates the transparency of the green color
      

      【讨论】:

      • 好吧,不过他应该知道还有这个选项。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-07
      • 2020-10-10
      • 1970-01-01
      • 2020-09-20
      • 1970-01-01
      相关资源
      最近更新 更多