本文整理汇总了C#中Microsoft.Xna.Framework.Color类的典型用法代码示例。如果您正苦于以下问题:C# Color类的具体用法?C# Color怎么用?C# Color使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Color类属于Microsoft.Xna.Framework命名空间,在下文中一共展示了Color类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例4: DrawStyle
public DrawStyle(Color fillColor, float fillAlpha, Color lineColor, float lineAlpha)
{
FillColor = fillColor;
LineColor = lineColor;
FillAlpha = fillAlpha;
LineAlpha = lineAlpha;
}
示例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;
}
示例6: Score
public Score(int positionX,int positionY,Color color)
{
this.positionX = positionX;
this.positionY = positionY;
this.color = color;
score = 0;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例11: FontDescription
public FontDescription(string assetName, string text, Color color, Vector2 position)
{
AssetName = assetName;
Text = text;
Color = color;
Position = position;
}
示例12: TransitionScreen
public TransitionScreen(ScreenManager sceneManager, Texture2D texture)
{
SetBasicParams(sceneManager);
this.texture = texture;
color = Color.White;
}
示例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;
}
示例14: TextControl
public TextControl(string text, SpriteFont font, Color color, Vector2 position)
{
this.text = text;
this.font = font;
this.Position = position;
this.Color = color;
}
示例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");
}