當前位置: 首頁>>代碼示例>>C#>>正文


C# Color.ToPremultiplied方法代碼示例

本文整理匯總了C#中Color.ToPremultiplied方法的典型用法代碼示例。如果您正苦於以下問題:C# Color.ToPremultiplied方法的具體用法?C# Color.ToPremultiplied怎麽用?C# Color.ToPremultiplied使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Color的用法示例。


在下文中一共展示了Color.ToPremultiplied方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawSprite

 public void DrawSprite(int x, int y, int width, int height, string image, Color color, bool flipX)
 {
     this.m_Context.SpriteBatch.Draw(
         this.m_Context.Textures[image],
         new Rectangle(x, y, width, height),
         null,
         color.ToPremultiplied(),
         0,
         new Vector2(0, 0),
         SpriteEffects.FlipHorizontally,
         0
         );
 }
開發者ID:EgoIncarnate,項目名稱:Tychaia,代碼行數:13,代碼來源:XnaGraphics.cs

示例2: DrawSprite

 public void DrawSprite(int x, int y, int width, int height, string image, Color color, bool flipX, double rotation = 0, Vector2? origin = null)
 {
     if (!this.m_Context.Textures.ContainsKey(image))
         throw new InvalidOperationException("The image '" + image + "' has not yet been loaded.");
     this.m_Context.SpriteBatch.Draw(
         this.m_Context.Textures[image],
         new Rectangle(x, y, width, height),
         null,
         color.ToPremultiplied(),
         (float)rotation,
         origin ?? new Vector2(0, 0),
         SpriteEffects.FlipHorizontally,
         0
     );
 }
開發者ID:hach-que,項目名稱:RedMeansGo,代碼行數:15,代碼來源:XnaGraphics.cs

示例3: DrawSpriteAt

 private void DrawSpriteAt(GameContext context, float x, float y, int width, int height, string image, Color color, bool flipX)
 {
     if (flipX)
         context.SpriteBatch.Draw(
             context.Textures[image],
             new Rectangle((int)x, (int)y, width, height),
             null,
             color.ToPremultiplied(),
             0,
             new Vector2(0, 0),
             SpriteEffects.FlipHorizontally,
             0
             );
     else
         context.SpriteBatch.Draw(
             context.Textures[image],
             new Rectangle((int)x, (int)y, width, height),
             color.ToPremultiplied()
             );
 }
開發者ID:EgoIncarnate,項目名稱:Tychaia,代碼行數:20,代碼來源:WorldManager.cs

示例4: DrawSpriteAt

 private void DrawSpriteAt(GameContext context, float x, float y, int width, int height, string image, Color color, bool flipX, double rotation, Vector2 origin)
 {
     if (!context.Textures.ContainsKey(image))
         throw new InvalidOperationException("The image '" + image + "' has not yet been loaded.");
     if (flipX)
         context.SpriteBatch.Draw(
             context.Textures[image],
             new Rectangle((int)x, (int)y, width, height),
             null,
             color.ToPremultiplied(),
             (float)rotation,
             origin,
             SpriteEffects.FlipHorizontally,
             0
         );
     else
         context.SpriteBatch.Draw(
             context.Textures[image],
             new Rectangle((int)x, (int)y, width, height),
             null,
             color.ToPremultiplied(),
             (float)rotation,
             origin,
             SpriteEffects.None,
             0
         );
 }
開發者ID:hach-que,項目名稱:RedMeansGo,代碼行數:27,代碼來源:WorldManager.cs


注:本文中的Color.ToPremultiplied方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。