public virtual void draw(SpriteBatch spriteBatch, drawMode dm) { switch (dm) { case drawMode.Keyline: Game1.scrmgr.drawTexture(spriteBatch, shipTex[(int)texture], position, Color.Black, drawSize - ((1 - health) * 0.16f), rotate); if (isBoss) { Game1.scrmgr.drawTexture(spriteBatch, shipTex[(int)texture], position, Color.Black, drawSize - ((1 - health) * 0.16f), rotate * -1); } break; case drawMode.Bottom: Game1.scrmgr.drawTexture(spriteBatch, shipTex[(int)texture], position, shield, drawSize - ((1 - health) * 0.16f) - 0.05f, rotate); if (isBoss) { Game1.scrmgr.drawTexture(spriteBatch, shipTex[(int)texture], position, shield, drawSize - ((1 - health) * 0.16f) - 0.05f, rotate * -1); } break; case drawMode.Top: Game1.scrmgr.drawTexture(spriteBatch, shipTex[(int)texture], position, enemyColor, drawSize - 0.175f, rotate); if (isBoss) { Game1.scrmgr.drawTexture(spriteBatch, shipTex[(int)texture], position, enemyColor, drawSize - 0.175f, rotate * -1); } break; } }
public void Draw(SpriteBatch spriteBatch, drawMode dm, GameTime gameTime) { if (callIn && drawCore) { switch (dm) { case drawMode.Keyline: Game1.scrmgr.drawTexture(spriteBatch, Enemy.shipTex[1], basePosition, Color.Black, 0.5f - ((1 - coreHealth) * 0.16f), 0); for (i = 0; i < bd.blockOffset.Count; i++) { Game1.scrmgr.drawTexture(spriteBatch, Enemy.shipTex[bd.blockType[i]], basePosition + bd.blockOffset[i], Color.Black, 0.5f - ((1 - blockHealth[i]) * 0.16f), ((float)gameTime.TotalGameTime.TotalMilliseconds / 100) * (2 * bd.blockOffset[i].Y)); } break; case drawMode.Bottom: Game1.scrmgr.drawTexture(spriteBatch, Enemy.shipTex[1], basePosition, coreShield, 0.5f - ((1 - coreHealth) * 0.16f) - 0.05f, 0); for (i = 0; i < bd.blockOffset.Count; i++) { Game1.scrmgr.drawTexture(spriteBatch, Enemy.shipTex[bd.blockType[i]], basePosition + bd.blockOffset[i], new Color(blockShieldColor[i], blockShieldColor[i], blockShieldColor[i]), 0.5f - ((1 - blockHealth[i]) * 0.16f) - 0.05f, ((float)gameTime.TotalGameTime.TotalMilliseconds / 100) * (2 * bd.blockOffset[i].Y) ); } break; case drawMode.Top: Game1.scrmgr.drawTexture(spriteBatch, Enemy.shipTex[1], basePosition, coreCore, 0.5f - 0.175f, 0); for (i = 0; i < bd.blockOffset.Count; i++) { Game1.scrmgr.drawTexture(spriteBatch, Enemy.shipTex[bd.blockType[i]], basePosition + bd.blockOffset[i], blockCoreColor[i], 0.5f - 0.175f, ((float)gameTime.TotalGameTime.TotalMilliseconds / 100) * (2 * bd.blockOffset[i].Y)); } break; } } }
private void canvas_MouseUp(object sender, MouseEventArgs e) { initialX = initialY = null; isPainting = false; if (mode != drawMode.BRUSH) { mode = drawMode.BRUSH; } }
internal void intialize() { canvasPanel.BackColor = Color.White; brushColorButton.BackColor = Color.Black; brushSizeButton.Text = "1"; shapeSizeButton.Text = "20"; isPainting = false; initialX = initialY = null; mode = drawMode.BRUSH; g = canvasPanel.CreateGraphics(); }
private void createRectangle_Click(object sender, EventArgs e) { if (mode == drawMode.RECTANGLE) { turnOffTool(mode); } else { turnOffTool(mode); mode = drawMode.RECTANGLE; createRectangle.Checked = true; } }
private void createSquareButton_Click(object sender, EventArgs e) { if (mode == drawMode.SQUARE) { turnOffTool(mode); } else { turnOffTool(mode); mode = drawMode.SQUARE; createSquareButton.Checked = true; } }
private void createCircleButton_Click(object sender, EventArgs e) { if (mode == drawMode.CIRCLE) { turnOffTool(mode); } else { turnOffTool(mode); mode = drawMode.CIRCLE; createCircleButton.Checked = true; } }
public void Draw(GameTime gametime, SpriteBatch spriteBatch, drawMode dm) { switch (dm) { case drawMode.Keyline: Game1.scrmgr.drawTexture(spriteBatch, tex, position, Color.Black, drawScale + (health * 0.005f) + 0.02f, rotation); break; case drawMode.Bottom: Game1.scrmgr.drawTexture(spriteBatch, tex, position, shield, drawScale + (health * 0.005f), rotation); break; case drawMode.Top: Game1.scrmgr.drawTexture(spriteBatch, tex, position, c, drawScale - (health * 0.005f) - 0.005f, rotation); break; } Game1.scrmgr.drawTexture(spriteBatch,Shape.CircleFade, position, painColor, drawScale - (health * 0.005f) - 0.005f, rotation); }
/// <summary> /// Draw Reflection /// </summary> /// <param name="img">Set Image</param> /// <param name="toBG">Set Color of Background</param> /// <param name="toBG1">Set Color of Background</param> /// <param name="drawMode">Set the Draw Mode. Default value is Solid</param> /// <param name="RotateFlipType">Set Rotation. Default value is Rotate180FlipX</param> /// <param name="LinearGradientMode">Set Gradient Mode. Default value is Vertical</param> /// <param name="Length">Set the length. Default value is 100</param> /// <returns></returns> public static Image DrawReflection(Image img, Color toBG, Color toBG1, drawMode drawMode = drawMode.Solid, RotateFlipType RotateFlipType = RotateFlipType.Rotate180FlipX, LinearGradientMode LinearGradientMode = LinearGradientMode.Vertical, int Length = 100) // img is the original image. { //This is the static function that generates the reflection... int height = img.Height + Length; //Added height from the original height of the image. System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img.Width, height, PixelFormat.Format64bppPArgb); //A new bitmap. Brush brsh = null;//The Brush that generates the fading effect to a specific color of your background. switch (drawMode) { case drawMode.Solid: brsh = new LinearGradientBrush(new Rectangle(0, 0, img.Width + 10, height), Color.Transparent, toBG, LinearGradientMode); //The Brush that generates the fading effect to a specific color of your background. break; case drawMode.Gradient: brsh = new LinearGradientBrush(new Rectangle(0, 0, img.Width + 10, height), Color.Transparent, toBG, LinearGradientMode); //The Brush that generates the fading effect to a specific color of your background. break; case drawMode.Hatch: brsh = new LinearGradientBrush(new Rectangle(0, 0, img.Width + 10, height), toBG1, toBG, LinearGradientMode); //The Brush that generates the fading effect to a specific color of your background. break; default: break; } bmp.SetResolution(img.HorizontalResolution, img.VerticalResolution); //Sets the new bitmap's resolution. using (System.Drawing.Graphics grfx = System.Drawing.Graphics.FromImage(bmp)) //A graphics to be generated from an image (here, the new Bitmap we've created (bmp)). { System.Drawing.Bitmap bm = (System.Drawing.Bitmap)img; //Generates a bitmap from the original image (img). grfx.DrawImage(bm, 0, 0, img.Width, img.Height); //Draws the generated bitmap (bm) to the new bitmap (bmp). System.Drawing.Bitmap bm1 = (System.Drawing.Bitmap)img; //Generates a bitmap again from the original image (img). bm1.RotateFlip(RotateFlipType); //Flips and rotates the image (bm1). grfx.DrawImage(bm1, 0, img.Height); //Draws (bm1) below (bm) so it serves as the reflection image. Rectangle rt = new Rectangle(0, img.Height, img.Width, Length); //A new rectangle to paint our gradient effect. grfx.FillRectangle(brsh, rt); //Brushes the gradient on (rt). } return(bmp); //Returns the (bmp) with the generated image. }
public MainForm() { InitializeComponent(); msPaint = DrawSpace.CreateGraphics(); bm = new Bitmap(DrawSpace.Width, DrawSpace.Height); msPaint = Graphics.FromImage(bm); /*default color*/ curColor = Color.Black; /*set solid brush*/ mSolidBrush = new SolidBrush(curColor); /*set pen*/ mPen = new Pen(curColor, curLineSize); mPen.SetLineCap(System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.DashCap.Round); /*set mode*/ curMode = drawMode.Pencil; /*disable line size*/ LineSize.Enabled = false; LinesSize(); }
/// <summary> /// Initializes a new instance of the <see cref="ProgressInput"/> class. /// </summary> /// <param name="info">The information.</param> /// <param name="context">The context.</param> public ProgressInput(SerializationInfo info, StreamingContext context) { solidBars = (ProgressBar)info.GetValue("solidBars", typeof(ProgressBar)); fixedSize = info.GetBoolean("fixedSize"); allowTransparency = info.GetBoolean("allowTransparency"); autoIncrement = info.GetBoolean("autoIncrement"); transparencyAnimatorGlow = info.GetBoolean("transparencyAnimatorGlow"); showText = info.GetBoolean("showText"); startingAngle = (float)info.GetValue("startingAngle", typeof(float)); value = (float)info.GetValue("value", typeof(float)); maximum = (float)info.GetValue("maximum", typeof(float)); minimum = (float)info.GetValue("minimum", typeof(float)); speed = (int[])info.GetValue("speed", typeof(int[])); transparency = info.GetInt32("transparency"); drawingMode = (drawMode)info.GetValue("drawingMode", typeof(drawMode)); easingType = (PeaceAnimatorEasing)info.GetValue("easingType", typeof(PeaceAnimatorEasing)); transparencyEasingType = (transparencyEasingType)info.GetValue("transparencyEasingType", typeof(transparencyEasingType)); postFix = info.GetString("postFix"); hatchBrushgradient1 = (Color)info.GetValue("hatchBrushgradient1", typeof(Color)); hatchBrushgradient2 = (Color)info.GetValue("hatchBrushgradient2", typeof(Color)); hatchBrushType = (ZeroitThematicProgress.HatchBrushType)info.GetValue("hatchBrushType", typeof(ZeroitThematicProgress.HatchBrushType)); autoAnimate = info.GetBoolean("autoAnimate"); autoAnimateStatingAngle = info.GetBoolean("autoAnimateStatingAngle"); //#region ProgressPerfect //ProgressPerfect_interval = info.GetInt32("ProgressPerfect_interval"); //ProgressPerfect_circleColor = (Color)info.GetValue("ProgressPerfect_circleColor", typeof(Color)); //ProgressPerfect_circleSize = (float)info.GetValue("ProgressPerfect_circleSize", typeof(float)); //_numberOfCircles = (float)info.GetValue("_numberOfCircles", typeof(float)); //_numberOfVisibleCircles = info.GetInt32("_numberOfVisibleCircles"); //ProgressPerfect_rotation = (RotationType1)info.GetValue("ProgressPerfect_rotation", typeof(RotationType1)); //ProgressPerfect_percentage = (float)info.GetValue("ProgressPerfect_percentage", typeof(float)); //ProgressPerfect_showPercentage = info.GetBoolean("ProgressPerfect_showPercentage"); //ProgressBarPerfect_showText = info.GetBoolean("ProgressBarPerfect_showText"); //ProgressPerfect_textDisplay = (TextDisplayModes1)info.GetValue("ProgressPerfect_textDisplay", typeof(TextDisplayModes1)); //ProgressBarPerfect_customText = (string)info.GetValue("ProgressBarPerfect_customText", typeof(string)); //#endregion }
private void turnOffTool(drawMode currentMode) { mode = drawMode.BRUSH; switch (currentMode) { case drawMode.CIRCLE: createCircleButton.Checked = false; break; case drawMode.RECTANGLE: createRectangle.Checked = false; break; case drawMode.SQUARE: createSquareButton.Checked = false; break; default: break; } }
public void Draw(SpriteBatch spriteBatch, drawMode dm) { for (int i = 0; i < barrierPosition.Count; i++) { if (!barrierIsDead[i]) { switch (dm) { case drawMode.Keyline: Game1.scrmgr.drawTexture(spriteBatch, wallTex, barrierPosition[i], Color.Black, sizeMod + (0.1f * barrierHealth[i]) + (((float)Math.Sin(barrierSizeMod[i]) * 2 - 1) * 0.01f), 0); break; case drawMode.Bottom: Game1.scrmgr.drawTexture(spriteBatch, wallTex, barrierPosition[i], shieldColor[i], sizeMod - 0.05f + (0.1f * barrierHealth[i]) + (((float)Math.Sin(barrierSizeMod[i]) * 2 - 1) * 0.01f), 0); break; case drawMode.Top: Game1.scrmgr.drawTexture(spriteBatch, wallTex, barrierPosition[i], barrierColor[i], sizeMod - 0.15f, 0); break; } } } }
public void Draw(SpriteBatch spriteBatch, drawMode dm) { switch (dm) { case drawMode.Keyline: Game1.scrmgr.drawTexture(spriteBatch, PlayerBuffs.tex, position, Color.White, scaleOne + new Vector2(0.075f,0.075f), 0); break; case drawMode.Bottom: Game1.scrmgr.drawTexture(spriteBatch, PlayerBuffs.tex, position, Color.Black, scaleTwo + new Vector2(0.06f,0.06f), 0); break; case drawMode.Top: Game1.scrmgr.drawTexture(spriteBatch, PlayerBuffs.tex, position, coreColor, scaleOne + new Vector2(0.035f,0.035f), 0); break; } }
private void Pencil_Click(object sender, EventArgs e) { curMode = drawMode.Pencil; LineSize.Enabled = false; }
private void Brush_Click(object sender, EventArgs e) { curMode = drawMode.Brush; curLineSize = 1; LineSize.Enabled = true; }
private void rectangle_Click(object sender, EventArgs e) { curMode = drawMode.Rectangle; LineSize.Enabled = true; }
private void ellipse_Click(object sender, EventArgs e) { curMode = drawMode.Ellipse; LineSize.Enabled = true; }
public override void draw(SpriteBatch spriteBatch, drawMode dm) { base.draw(spriteBatch, dm); }