当前位置: 首页>>代码示例>>C#>>正文


C# Graphics.LColor类代码示例

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


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


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