public override void Draw(SpriteBatch spriteBatch, MGCamera camera) { if (_isEnded) { _electricEffect.Draw(); } }
public override void Draw(SpriteBatch spriteBatch, MGCamera camera) { if (Visible) { Vector2 position; Vector2 vector; base.ConvertToWorld(out position, out vector); float rotation = base.ConvertToWorldRot(); Color color = _color * (_opacity / 255f); color.A = (byte)_opacity; if (camera == null) { spriteBatch.Begin(SpriteSortMode.BackToFront, _blendState); } else { spriteBatch.Begin(SpriteSortMode.BackToFront, _blendState, null, null, null, null, camera.Transform); } spriteBatch.Draw(Texture, position, new Rectangle((int)FS.TextCoords.X, (int)FS.TextCoords.Y, (int)FS.Width, (int)FS.Width), color, rotation, _anchorPoisiton, _scale, SpriteEffects.None, 0f); spriteBatch.End(); } }
public override void DrawNode(SpriteBatch spriteBatch, MGCamera camera) { if (Ratio < 0.5) { OutScene.DrawNode(spriteBatch, camera); MGDirector.SharedDirector().BasicEffect.Alpha = (float) (Ratio/0.5); MGPrimitives.DrawPoly(P, Color.White); return; } InScene.DrawNode(spriteBatch, camera); MGDirector.SharedDirector().BasicEffect.Alpha = (float) (1.0 - (Ratio - 0.5)/0.5); MGPrimitives.DrawPoly(P, Color.White); }
public override void Draw(SpriteBatch spriteBatch, MGCamera camera) { if (Visible) { Vector2 position; Vector2 scale; base.ConvertToWorld(out position, out scale); float rotation = base.ConvertToWorldRot(); position = new Vector2(position.X, MGDirector.WinHeight - position.Y); if (camera == null) { spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); } else { spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, camera.Transform); } spriteBatch.DrawString(_spriteFont, _text, position, _color, rotation, _anchorPoisiton, scale, SpriteEffects.None, 0f); spriteBatch.End(); } }
public virtual void DrawNode(SpriteBatch spriteBatch, MGCamera camera) { if (!Visible) { return; } MGCamera camera2 = _camera ?? camera; foreach (MGNode current in ChildList) { if (current.ZOrder < 0) { current.DrawNode(spriteBatch, camera2); } } Draw(spriteBatch, camera); int num = 0; for (int i = 0; i < ChildList.Count; i++) { MGNode node = ChildList[i]; if (node.ZOrder >= 0) { if (num == 0) { num = node.ZOrder; } else { num = node.ZOrder; } node.DrawNode(spriteBatch, camera2); } } }
public virtual void Draw(SpriteBatch spriteBatch, MGCamera camera) { }
public override void Draw(SpriteBatch spriteBatch, MGCamera camera) { Color color = _color * (_opacity / 255f); MGDirector.SharedDirector().BasicEffect.Alpha = _opacity / 255f; MGPrimitives.DrawPoly(_p, color); }