• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Graphics.LColor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Loon.Core.Graphics.LColor的典型用法代码示例。如果您正苦于以下问题:C# LColor类的具体用法?C# LColor怎么用?C# LColor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LColor类属于Loon.Core.Graphics命名空间,在下文中一共展示了LColor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DrawWait

            public DrawWait(int s, int width, int height)
            {
                this.style = s;
                this.width = width;
                this.height = height;
                this.color = new LColor(1f, 1f, 1f);
                switch (style)
                {
                    case 0:
                        int r1 = width / 8,
                        r2 = height / 8;
                        this.r = ((r1 < r2) ? r1 : r2) / 2;
                        this.list = new List<object>(Arrays.AsList<object>(new object[] {
											new RectBox(sx + 3 * r, sy + 0 * r, 2 * r, 2 * r),
											new RectBox(sx + 5 * r, sy + 1 * r, 2 * r, 2 * r),
											new RectBox(sx + 6 * r, sy + 3 * r, 2 * r, 2 * r),
											new RectBox(sx + 5 * r, sy + 5 * r, 2 * r, 2 * r),
											new RectBox(sx + 3 * r, sy + 6 * r, 2 * r, 2 * r),
											new RectBox(sx + 1 * r, sy + 5 * r, 2 * r, 2 * r),
											new RectBox(sx + 0 * r, sy + 3 * r, 2 * r, 2 * r),
											new RectBox(sx + 1 * r, sy + 1 * r, 2 * r, 2 * r) }));
                        break;
                    case 1:
                        this.Fill = new LColor(165, 0, 0, 255);
                        this.paintX = (width - ARCRADIUS);
                        this.paintY = (height - ARCRADIUS);
                        this.paintWidth = paintX + ARCRADIUS;
                        this.paintHeight = paintY + ARCRADIUS;
                        break;
                }
            }
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:31,代码来源:WaitSprite.cs


示例2: EmulatorButton

        public EmulatorButton(LTexture img, int w, int h, int x, int y,
                bool flag, int sizew, int sizeh)
        {
            this.color = new LColor(LColor.gray.R, LColor.gray.G,
                            LColor.gray.B, 125);
            img.LoadTexture();
            if (flag)
               {
                this.bitmap = img.GetSubTexture(x, y, w, h);
            }
            else
            {
                this.bitmap = img;
            }
            if (bitmap.GetWidth() != sizew || bitmap.GetHeight() != sizeh)
            {

                LTexture tmp = bitmap;
                this.bitmap = bitmap.Scale(sizew, sizeh);

                if (tmp != null)
                {
                    tmp.Dispose();
                    tmp = null;
                }
            }
            this.bounds = new RectBox(0, 0, bitmap.GetWidth(), bitmap.GetHeight());
        }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:28,代码来源:EmulatorButton.cs


示例3: Label

		public Label(LFont font, string label, int x, int y) {
			this.font = font;
			this.label = label;
			this.color = LColor.black;
			this.visible = true;
			this.SetLocation(x, y);
		}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:7,代码来源:Label.cs


示例4: FilterColor

 public static LTexture FilterColor(string res, LColor height, Loon.Core.Graphics.Opengl.LTexture.Format format)
 {
     uint color = height.GetRGB();
     LImage tmp = LImage.CreateImage(res);
     LImage image = LImage.CreateImage(tmp.GetWidth(), tmp.GetHeight(), true);
     LGraphics g = image.GetLGraphics();
     g.DrawImage(tmp, 0, 0);
     g.Dispose();
     if (tmp != null)
     {
         tmp.Dispose();
         tmp = null;
     }
     Color[] pixels = image.GetPixels();
     int size = pixels.Length;
     for (int i = 0; i < size; i++)
     {
         if (pixels[i].PackedValue == color)
         {
             pixels[i].PackedValue = LSystem.TRANSPARENT;
         }
     }
     image.SetFormat(format);
     image.SetPixels(pixels, image.GetWidth(), image.GetHeight());
     LTexture texture = image.GetTexture();
     if (image != null)
     {
         image.Dispose();
         image = null;
     }
     return texture;
 }
开发者ID:ordanielcmessias,项目名称:LGame,代码行数:32,代码来源:TextureUtils.cs


示例5: LGradation

		private LGradation(LColor s, LColor e, int w, int h, int alpha) {
			this.start = s;
			this.end = e;
			this.width = w;
			this.height = h;
			this.alpha = alpha;
		}
开发者ID:keppelcao,项目名称:LGame,代码行数:7,代码来源:LGradation.cs


示例6: GetColor

		public LColor GetColor(uint c) {
            LColor color = (LColor)CollectionUtils.Get(ColorMap, c);
			if (color == null) {
				color = new LColor(c);
                CollectionUtils.Put(ColorMap, c, color);
			}
			return color;
		}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:8,代码来源:LColorPool.cs


示例7: FadeEffect

		public FadeEffect(LColor c, int delay, int type, int w, int h) {
			this.visible = true;
			this.type = type;
			this.SetDelay(delay);
			this.SetColor(c);
			this.width = w;
			this.height = h;
		}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:8,代码来源:FadeEffect.cs


示例8: Draw

		public void Draw(int idx, SpriteBatch batch, float x, float y,
				float rotation, float sx, float sy, LColor color) {
			RectBox rect = this._rectList[idx];
			batch.SetColor(color);
			batch.Draw(_texture, x, y, anchor.x, anchor.y, rect.width, rect.height,
					sx, sy, MathUtils.ToDegrees(rotation), rect.x, rect.y,
					rect.width, rect.height, false, false);
			batch.ResetColor();
		}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:9,代码来源:LNTextureAtlas.cs


示例9: ArcEffect

 public ArcEffect(LColor c, int x, int y, int width, int height)
 {
     this.SetLocation(x, y);
     this.width = width;
     this.height = height;
     this.timer = new LTimer(200);
     this.color = (c == null) ? LColor.black : c;
     this.visible = true;
 }
开发者ID:keppelcao,项目名称:LGame,代码行数:9,代码来源:ArcEffect.cs


示例10: NewArc

        public static LTransition NewArc(LColor c)
        {
            if (GLEx.Self != null)
            {

                LTransition transition = new LTransition();
                transition.SetTransitionListener(new _Arc(c));
                transition.SetDisplayGameUI(true);
                transition.code = 1;
                return transition;
            }
            return null;
        }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:13,代码来源:LTransition.cs


示例11: Draw

 public void Draw(GLEx g, int x, int y, int sx, int sy, LColor color)
 {
     if (target.IsBatch())
     {
         float nx = sx * tw;
         float ny = sy * th;
         target.Draw(x, y, tw, th, nx, ny, nx + tw, ny + th, color);
     }
     else
     {
         CheckImage(sx, sy);
         g.DrawTexture(subImages[sx][sy], x, y);
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:14,代码来源:SpriteSheet.cs


示例12: CreateTexture

 public static LTexture CreateTexture(int width, int height, LColor c)
 {
     LImage image = LImage.CreateImage(width, height, false);
     LGraphics g = image.GetLGraphics();
     g.SetColor(c);
     g.FillRect(0, 0, width, height);
     g.Dispose();
     LTexture tex2d = image.GetTexture();
     if (image != null)
     {
         image.Dispose();
         image = null;
     }
     return tex2d;
 }
开发者ID:ordanielcmessias,项目名称:LGame,代码行数:15,代码来源:TextureUtils.cs


示例13: GetColor

 public LColor GetColor(float r, float g, float b, float a)
 {
     int hashCode = 1;
     hashCode = LSystem.Unite(hashCode, r);
     hashCode = LSystem.Unite(hashCode, g);
     hashCode = LSystem.Unite(hashCode, b);
     hashCode = LSystem.Unite(hashCode, a);
     LColor color = (LColor)CollectionUtils.Get(colorMap, hashCode);
     if (color == null)
     {
         color = new LColor(r, g, b, a);
         CollectionUtils.Put(colorMap, hashCode
             , color);
     }
     return color;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:16,代码来源:LColorPool.cs


示例14: Blood

 public Blood(LColor c, int x, int y)
 {
     this.SetLocation(x, y);
     this.color = c;
     this.timer = new LTimer(20);
     this.drops = new Drop[20];
     this.limit = 50;
     for (int i = 0; i < drops.Length; ++i)
     {
         SetBoolds(i, x, y, 6.0f * (MathUtils.Random() - 0.5f), -2.0f
                 * MathUtils.Random());
     }
     this.xSpeed = 0F;
     this.ySpeed = 0.5F;
     this.step = 0;
     this.visible = true;
 }
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:17,代码来源:Blood.cs


示例15: GetInstance

		public static LGradation GetInstance(LColor s, LColor e, int w, int h,
				int alpha) {
			if (gradations == null) {
                gradations = new Dictionary<string, LGradation>(10);
			}
			int hashCode = 1;
			hashCode = LSystem.Unite(hashCode, s.GetRGB());
			hashCode = LSystem.Unite(hashCode, e.GetRGB());
			hashCode = LSystem.Unite(hashCode, w);
			hashCode = LSystem.Unite(hashCode, h);
			hashCode = LSystem.Unite(hashCode, alpha);
			string key = Convert.ToString(hashCode);
			LGradation o = (LGradation) CollectionUtils.Get(gradations,key);
			if (o == null) {
                CollectionUtils.Put(gradations,key, o = new LGradation(s, e, w, h, alpha));
			}
			return o;
		}
开发者ID:keppelcao,项目名称:LGame,代码行数:18,代码来源:LGradation.cs


示例16: LoadBarColor

 public LTexture LoadBarColor(LColor c1, LColor c2, LColor c3)
 {
     if (colors.Count > 10)
     {
         lock (colors)
         {
             foreach (LTexture tex2d in colors.Values)
             {
                 if (tex2d != null)
                 {
                     tex2d.Destroy();
                 }
             }
             colors.Clear();
         }
     }
     int hash = 1;
     hash = LSystem.Unite(hash, c1.GetRGB());
     hash = LSystem.Unite(hash, c2.GetRGB());
     hash = LSystem.Unite(hash, c3.GetRGB());
     LTexture texture = null;
     lock (colors)
     {
         texture = (LTexture)CollectionUtils.Get(colors, hash);
     }
     if (texture == null)
     {
         LImage image = LImage.CreateImage(8, 8, false);
         LGraphics g = image.GetLGraphics();
         g.SetColor(c1);
         g.FillRect(0, 0, 4, 4);
         g.SetColor(c2);
         g.FillRect(4, 0, 4, 4);
         g.SetColor(c3);
         g.FillRect(0, 4, 4, 4);
         g.Dispose();
         texture = image.GetTexture();
         CollectionUtils.Put(colors, hash, texture);
     }
     return (this.texture = texture);
 }
开发者ID:keppelcao,项目名称:LGame,代码行数:41,代码来源:StatusBar.cs


示例17: FilterLimitColor

 public static LTexture FilterLimitColor(string res, LColor start,
         LColor end, Loon.Core.Graphics.Opengl.LTexture.Format format)
 {
     int sred = start.R;
     int sgreen = start.G;
     int sblue = start.B;
     int ered = end.R;
     int egreen = end.G;
     int eblue = end.B;
     LImage tmp = LImage.CreateImage(res);
     LImage image = LImage.CreateImage(tmp.GetWidth(), tmp.GetHeight(), true);
     LGraphics g = image.GetLGraphics();
     g.DrawImage(tmp, 0, 0);
     g.Dispose();
     if (tmp != null)
     {
         tmp.Dispose();
         tmp = null;
     }
     Color[] pixels = image.GetPixels();
     int size = pixels.Length;
     for (int i = 0; i < size; i++)
     {
         Color pixel = pixels[i];
         if ((pixel.R >= sred && pixel.G >= sgreen && pixel.B >= sblue)
                 && (pixel.R <= ered && pixel.G <= egreen && pixel.B <= eblue))
         {
             pixels[i].PackedValue = LSystem.TRANSPARENT;
         }
     }
     image.SetFormat(format);
     image.SetPixels(pixels, image.GetWidth(), image.GetHeight());
     LTexture texture = image.GetTexture();
     if (image != null)
     {
         image.Dispose();
         image = null;
     }
     return texture;
 }
开发者ID:keppelcao,项目名称:LGame,代码行数:40,代码来源:TextureUtils.cs


示例18: Cycle

        public Cycle(List<object[]> path_0, int x_1, int y_2, int w, int h)
        {
            if (path_0 != null)
            {
                CollectionUtils.Add(data, CollectionUtils.ToArray(path_0));
                isUpdate = true;
            }
            else
            {
                data = new List<object[]>(10);
            }

            this.SetLocation(x_1, y_2);
            this.timer = new LTimer(25);
            this.color = LColor.white;
            this.points = new List<CycleProgress>();
            this.multiplier = 1;
            this.pointDistance = 0.05f;
            this.padding = 0;
            this.stepType = 0;
            this.stepsPerFrame = 1;
            this.trailLength = 1;
            this.scaleX = 1;
            this.scaleY = 1;
            this.alpha = 1;
            this.blockWidth = w;
            this.blockHeight = h;
            this.blockHalfWidth = w / 2;
            this.blockHalfHeight = h / 2;
            if (signatures == null)
            {
                signatures = new Dictionary<Int32, float[]>(3);
                CollectionUtils.Put(signatures, ARC, new float[] { 1, 1, 3, 2, 2, 0 });
                CollectionUtils.Put(signatures, BEZIER, new float[] { 1, 1, 1, 1, 1, 1, 1, 1 });
                CollectionUtils.Put(signatures, LINE, new float[] { 1, 1, 1, 1 });
            }
            this.Setup();
            this.isVisible = true;
        }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:39,代码来源:Cycle.cs


示例19: Light

 public Light(float x, float y, float str, LColor col)
 {
     this.xpos = x;
     this.ypos = y;
     this.strength = str;
     this.color = col;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:7,代码来源:LLight.cs


示例20: SetFilterColor

 public void SetFilterColor(LColor f)
 {
     this.filterColor.SetColor(f);
 }
开发者ID:ordanielcmessias,项目名称:LGame,代码行数:4,代码来源:SpriteBatchObject.cs



注:本文中的Loon.Core.Graphics.LColor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OpenGL.LTexture类代码示例发布时间:2022-05-26
下一篇:
C# Geom.Vector2f类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap