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

C# Framework.Color类代码示例

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

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



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

示例1: FloppyDisc

        public FloppyDisc(Game game, SpriteBatch spriteBatch, Texture2D texture, Texture2D overlayTexture, Color color, Color overlayColor,
			Vector2 position, float rotation , float scale, float layerDepth, int points)
            : base(game, spriteBatch, texture, color, position, rotation, scale, layerDepth, points)
        {
            this.overlayTexture = overlayTexture;
            this.overlayColor = overlayColor;
        }
开发者ID:UnaviaMedia,项目名称:CaptainCPA,代码行数:7,代码来源:FloppyDisc.cs


示例2: Set

 public void Set(float x, float y, float w, float h, Color color, Vector2 texCoordTL, Vector2 texCoordBR)
 {
   this.vertexTL.Position.X = x;
   this.vertexTL.Position.Y = y;
   this.vertexTL.Position.Z = this.Depth;
   this.vertexTL.Color = color;
   this.vertexTL.TextureCoordinate.X = texCoordTL.X;
   this.vertexTL.TextureCoordinate.Y = texCoordTL.Y;
   this.vertexTR.Position.X = x + w;
   this.vertexTR.Position.Y = y;
   this.vertexTR.Position.Z = this.Depth;
   this.vertexTR.Color = color;
   this.vertexTR.TextureCoordinate.X = texCoordBR.X;
   this.vertexTR.TextureCoordinate.Y = texCoordTL.Y;
   this.vertexBL.Position.X = x;
   this.vertexBL.Position.Y = y + h;
   this.vertexBL.Position.Z = this.Depth;
   this.vertexBL.Color = color;
   this.vertexBL.TextureCoordinate.X = texCoordTL.X;
   this.vertexBL.TextureCoordinate.Y = texCoordBR.Y;
   this.vertexBR.Position.X = x + w;
   this.vertexBR.Position.Y = y + h;
   this.vertexBR.Position.Z = this.Depth;
   this.vertexBR.Color = color;
   this.vertexBR.TextureCoordinate.X = texCoordBR.X;
   this.vertexBR.TextureCoordinate.Y = texCoordBR.Y;
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:27,代码来源:SpriteBatchItem.cs


示例3: DrawRoundedBlurPanel

		public static void DrawRoundedBlurPanel(IBatchRenderer sbatch, FRectangle bounds, Color color, float scale = 1f)
		{
			StaticTextures.ThrowIfNotInitialized();

			DrawRoundedBlurPanelBackgroundPart(sbatch, bounds, scale);
			DrawRoundedBlurPanelSolidPart(sbatch, bounds, color, scale);
		}
开发者ID:Mikescher,项目名称:GridDominance,代码行数:7,代码来源:FlatRenderHelper.cs


示例4: DrawStyle

 public DrawStyle(Color fillColor, float fillAlpha, Color lineColor, float lineAlpha)
 {
     FillColor = fillColor;
     LineColor = lineColor;
     FillAlpha = fillAlpha;
     LineAlpha = lineAlpha;
 }
开发者ID:hgrandry,项目名称:Mgx,代码行数:7,代码来源:DrawStyle.cs


示例5: CreateTexture

 private Texture2D CreateTexture(GraphicsDevice graphicsDevice, Rectangle bounds, Color color)
 {
     var texture = new Texture2D(graphicsDevice, bounds.Width, bounds.Height);
     texture.FillWithColor(color);
     texture.AddBorder(Color.Black, 1);
     return texture;
 }
开发者ID:kavengagne,项目名称:TetrisGame,代码行数:7,代码来源:PreviewPanel.cs


示例6: Score

 public Score(int positionX,int positionY,Color color)
 {
     this.positionX = positionX;
     this.positionY = positionY;
     this.color = color;
     score = 0;
 }
开发者ID:TheCoderPal,项目名称:terasoft-summer-reunited,代码行数:7,代码来源:Score.cs


示例7: Button

 public Button(Vector2 position, Vector2 size, TextureE textureE)
     : base(position, size, Vector2.Zero, 0f, Color.White, getTexture(textureE), Animation.getAnimation(getTexture(textureE)))
 {
     disp = new Vector2(10f, 10f);
     selectedColor = new Color(230, 230, 230);
     LayerDepth = 0.5f;
 }
开发者ID:danielgomezrico,项目名称:HeliumBiker-Game,代码行数:7,代码来源:Button.cs


示例8: DrawMenu

 public virtual void DrawMenu(SpriteBatch spriteBatch)
 {
     // Fade the popup alpha during transitions.
     _color = Color.White * _transitionAlpha;
     // Draw the background rectangle.
     spriteBatch.Draw(ImageManager.GradientTexture, backgroundRectangle, _color);
 }
开发者ID:ruairitobrien,项目名称:Nathaniel-WP7,代码行数:7,代码来源:PopUpScreen.cs


示例9: GameObject

 /// <summary>
 /// Crea un objeto tipo GameObject.
 /// </summary>
 /// <param name="effect">Effecto usado para dibujar.</param>
 /// <param name="engine">Clase principal del juego.</param>
 /// <param name="position">Posición del objeto.</param>
 /// <param name="size">Tamaño del objeto.</param>
 public GameObject(Engine engine, Vector3 position, float size)
     : base(engine)
 {
     this.size = size;
     color = Color.LightGray;
     this.position = position;
 }
开发者ID:alejopelaez,项目名称:eshcerworld,代码行数:14,代码来源:GameObject.cs


示例10: Initialize

        public override void Initialize()
        {
            Texture2D texture = GameInstance.Content.Load<Texture2D>("Terrain");
            Color[] colorData = new Color[texture.Width * texture.Height];

            texture.GetData(colorData);

            sbyte[,] data = new sbyte[texture.Width, texture.Height];

            for (int y = 0; y < texture.Height; y++)
            {
                for (int x = 0; x < texture.Width; x++)
                {
                    //If the color on the coordinate is black, we include it in the terrain.
                    bool inside = colorData[(y * texture.Width) + x] == Color.Black;

                    if (!inside)
                        data[x, y] = 1;
                    else
                        data[x, y] = -1;
                }
            }

            _terrain.ApplyData(data, new Vector2(250, 250));

            base.Initialize();
        }
开发者ID:tinco,项目名称:Farseer-Physics,代码行数:27,代码来源:DestructibleTerrainTest.cs


示例11: FontDescription

 public FontDescription(string assetName, string text, Color color, Vector2 position)
 {
     AssetName = assetName;
     Text = text;
     Color = color;
     Position = position;
 }
开发者ID:Vintharas,项目名称:WP7projects,代码行数:7,代码来源:FontDescription.cs


示例12: TransitionScreen

        public TransitionScreen(ScreenManager sceneManager, Texture2D texture)
        {
            SetBasicParams(sceneManager);

            this.texture = texture;
            color = Color.White;
        }
开发者ID:BGCX261,项目名称:zone-of-fighters-svn-to-git,代码行数:7,代码来源:TransitionScreen.cs


示例13: CreateTexture

        private Texture2D CreateTexture(Shape shape, object[] textureData)
        {
            // ignore any texture data.

            var bounds = shape.Bounds;
            Color[] colorArr = new Color[bounds.Width * bounds.Height];
            int index = 0;

            for (int x = 0; x < bounds.Width; x++)
            {
                for (int y = 0; y < bounds.Height; y++)
                {
                    index = y * bounds.Width + x;

                    if (shape.Contains(x + bounds.X, y + bounds.Y))
                        colorArr[index] = Color.White;
                    else
                        colorArr[index] = Color.Transparent;
                }
            }

            Texture2D texture = new Texture2D(_renderer.GraphicsDevice, bounds.Width, bounds.Height);
            texture.SetData(colorArr);
            return texture;
        }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:25,代码来源:SingleColorShapeTextureProvider.cs


示例14: TextControl

 public TextControl(string text, SpriteFont font, Color color, Vector2 position)
 {
     this.text = text;
     this.font = font;
     this.Position = position;
     this.Color = color;
 }
开发者ID:tomasmcguinness,项目名称:Bounce,代码行数:7,代码来源:TextControl.cs


示例15: StorePurchaseDialog

        public StorePurchaseDialog(Scene.ObjectRegistrationHandler registrationHandler, Scene.ObjectUnregistrationHandler unregistrationHandler)
            : base(registrationHandler, unregistrationHandler)
        {
            Height = Purchase_Dialog_Height;
            TopYWhenActive = Definitions.Back_Buffer_Height - (Purchase_Dialog_Height + Bopscotch.Scenes.NonGame.StoreScene.Dialog_Margin);
            CarouselCenter = new Vector2(Definitions.Back_Buffer_Center.X, Carousel_Center_Y);
            CarouselRadii = new Vector2(Carousel_Horizontal_Radius, Carousel_Vertical_Radius);
            _itemRenderDepths = new Range(Minimum_Item_Render_Depth, Maximum_Item_Render_Depth);
            _itemScales = new Range(Minimum_Item_Scale, Maximum_Item_Scale);

            AddIconButton("previous", new Vector2(Definitions.Back_Buffer_Center.X - 450, 175), Button.ButtonIcon.Previous, Color.DodgerBlue);
            AddIconButton("next", new Vector2(Definitions.Back_Buffer_Center.X + 450, 175), Button.ButtonIcon.Next, Color.DodgerBlue);

            AddButton("Back", new Vector2(Definitions.Left_Button_Column_X, 400), Button.ButtonIcon.Back, Color.DodgerBlue, 0.7f);
            AddButton("Buy", new Vector2(Definitions.Right_Button_Column_X, 400), Button.ButtonIcon.Tick, Color.Orange, 0.7f);

            _nonSpinButtonCaptions.Add("Buy");

            ActionButtonPressHandler = HandleActionButtonPress;
            TopYWhenInactive = Definitions.Back_Buffer_Height;

            SetupButtonLinkagesAndDefaultValues();

            registrationHandler(this);

            _textTransitionTimer = new Timer("");
            GlobalTimerController.GlobalTimer.RegisterUpdateCallback(_textTransitionTimer.Tick);
            _textTransitionTimer.NextActionDuration = 1;
            _textTint = Color.White;

            _font = Game1.Instance.Content.Load<SpriteFont>("Fonts\\arial");
        }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-IOS,代码行数:32,代码来源:StorePurchaseDialog.cs


示例16: LevelPortal

        public LevelPortal(World nWorld, Level nLevel, ContentManager nContentManager, Color nColor, Vector2 nPos, OnLevelPortalCollision nDelegate, Hashtable nConfig)
        {
            string nTextureName = "SpriteMaps/Portal";

            base.Init(nWorld, nLevel, nContentManager, nTextureName, nColor, nPos);

            //Populate the Hashtable SpriteMap with the values for the player spritemap
            AddFrame(SpriteState.Portal, 0, 0, 100, 100);
            AddFrame(SpriteState.Portal, 100, 0, 100, 100);
            AddFrame(SpriteState.Portal, 200, 0, 100, 100);

            //Default SpriteState
            SetState(SpriteState.Portal);

            //Manually step the animation to update the sprite Source rectangle
            StepAnimation();

            //Set callback for collisions
            Body.OnCollision += OnCollision;
            Body.OnSeparation += OnSeparation;

            //Other physical properties
            Body.BodyType = BodyType.Static;
            Body.IsSensor = true;
            Body.CollidesWith = Category.All;
            Body.CollisionCategories = Category.Cat30;
            Body.CollisionGroup = 30;
            Body.SleepingAllowed = false;
            Body.Position = nPos;

            OnPortalCollision = nDelegate;

            mLevelId = (int)nConfig["LevelId"];
        }
开发者ID:WilHall,项目名称:hakyn-client,代码行数:34,代码来源:LevelPortal.cs


示例17: DrawString

        public static void DrawString(this SpriteBatch spriteBatch, SpriteBitmapFont font, string text, Vector2 position, Color color, Color outlineColor)
        {
            var previousCharacter = ' ';
            var normalizedText = text.Replace("\r\n", "\n").Replace("\r", "\n");

            var x = 0;
            var y = 0;

            foreach (var character in normalizedText)
            {
                if (character == '\n')
                {
                    x = 0;
                    y += font.LineHeight;
                    continue;
                }

                var data = font[character];
                var kerning = font.GetKerning(previousCharacter, character);

                DrawSymbol(spriteBatch, font, data, (int)position.X + (x + data.Offset.X + kerning), (int)position.Y + (y + data.Offset.Y), color, outlineColor);
                x += data.XAdvance + kerning;

                previousCharacter = character;
            }
        }
开发者ID:MSigma,项目名称:ZooBurst,代码行数:26,代码来源:SpriteBatchExt.cs


示例18: DnaBar

 public DnaBar(float valueMax)
     : base(valueMax)
 {
     TwentyProcentColor = new Color(255, 0, 127, 200);
     FiftyProcentColor = new Color(255, 0, 127, 200);
     HundredProcentColor = new Color(255, 0, 127, 200);
 }
开发者ID:qvotaxon,项目名称:game-design-herkansing,代码行数:7,代码来源:DnaBar.cs


示例19: Tile

 public Tile(Texture2D texture, Color color, int x, int y, bool isWall)
 {
     this.texture = texture;
     this.color = color;
     this.isWall = isWall;
     rect = new Rectangle(x, y, SIZE, SIZE);
 }
开发者ID:opot,项目名称:ColorWar,代码行数:7,代码来源:Tile.cs


示例20: Net

        public Net(Vector3 position, int numBlocksX, int numBlocksY, float blockWidth, float blockHeight, Color color)
        {
            this.primitivesCount = numBlocksX + numBlocksY + 2;
            this.primitives = new IPrimitive[this.primitivesCount];

            GenerateNet(numBlocksX, numBlocksY, blockWidth, blockHeight, position, color);
        }
开发者ID:AleksandarDev,项目名称:LD26,代码行数:7,代码来源:Net.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Framework.Game类代码示例发布时间:2022-05-26
下一篇:
C# Framework.BoundingBox类代码示例发布时间: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