public Screen() { this.g = G.g; this.spriteBatch = g.spriteBatch; this.e = g.e; this.GraphicsDevice = g.GraphicsDevice; this.font = g.font; }
public override void DeviceReset(Microsoft.Xna.Framework.Graphics.GraphicsDevice Device) { }
public TextureFactory(ResourceFactory rf, XnaContentManager xcm, XnaGraphics graphics) : base(rf) { _content = xcm; _graphics = graphics; }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { base.OnLoad(content, gd); Bullet.Orientation = (float)Math.Atan2((double)Spell.Velocity.Y, (double)Spell.Velocity.X); }
public override void Load(Container container, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { base.Load(container, gd); AddParticlesTrail(100, TimeSpan.FromSeconds(1.0), Tint); }
public void Render(DwarfTime gameTime, ChunkManager chunks, Camera camera, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, DwarfCorp.Shader effect, bool renderingForWater) { if (GUIObject != null) { if (Enabled && IsVisible && camera.IsInView(GetBoundingBox())) { Vector3 screenPos = camera.Project(GlobalTransform.Translation); GUIObject.LocalBounds = new Rectangle((int)screenPos.X - GUIObject.LocalBounds.Width / 2, (int)screenPos.Y - GUIObject.LocalBounds.Height / 2, GUIObject.LocalBounds.Width, GUIObject.LocalBounds.Height); GUIObject.IsVisible = true; } else { GUIObject.IsVisible = false; } } }
public void Load(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice device) { //_effect = content.Load<Microsoft.Xna.Framework.Graphics.Effect>(@"Effects\"); base.Load(device); }
public MapRendererTests(Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { _graphicsDevice = graphicsDevice; }
void IRenderableComponent.Render(DwarfTime gameTime, ChunkManager chunks, Camera camera, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, Shader effect, bool renderingForWater) { if (GamePerformance.DebugVisualizationEnabled) { Drawer3D.DrawBox(GetBoundingBox(), Color.DarkRed, 0.02f, false); } }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { Rect rect = Champion.CreateCollisionRectangle(); Parent.AddChild(ChampionServerRect = new DrawableRectangle(rect, Color.Green)); Parent.AddChild(ChampionSimulatedRect = new DrawableRectangle(rect, Color.Red)); Parent.AddChild(ChampionNoCorrection = new DrawableRectangle(rect, Color.Yellow * 0.5f)); Parent.AddChild(ChampionCorrectionUsed = new DrawableRectangle(rect, Color.Blue * 0.8f)); ChampionNoCorrection.Visible = ChampionServerRect.Visible = ChampionSimulatedRect.Visible = ChampionCorrectionUsed.Visible = VIEW_DEBUG_RECTS; base.OnLoad(content, gd); }
/// <summary> /// Initialize Or Set The The public class /// </summary> /// <param name="graphicdevice">Xna Graphics Device Reference</param> public static void ApplyGraphicsDevice(Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicdevice) { cap = graphicdevice.GraphicsDeviceCapabilities; }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { Overlay = new DrawableRectangle(new GREATLib.Rect(0, 0, screenService.GameWindowSize.X, screenService.GameWindowSize.Y), Color.White); Overlay.Alpha = 0f; AddChild(Overlay); AddChild(Message = new DrawableLabel(), 2); Message.Scale = new Vector2(2f); Message.RelativeOrigin = new Vector2(0.5f); Message.SetPositionInScreenPercent(50, 50); base.OnLoad(content, gd); }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { base.OnLoad(content, gd); AddChild(Bullet); Bullet.RelativeOrigin = new Vector2(0.5f, 0.5f); }
/// <summary> /// Initialize /// </summary> /// <param name="_graphics">Reference To Graphics</param> public static void Initialize(Microsoft.Xna.Framework.Graphics.GraphicsDevice _graphics) { graphics = _graphics; }
public override void Draw(Microsoft.Xna.Framework.Graphics.GraphicsDevice device) { }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { Panel.SetPositionRelativeToScreen(ScreenBound.TopRight, new Vector2(-Kill.Width - ScreenOffset, ScreenOffset)); base.OnLoad(content, gd); }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { RedRectangle = new DrawableRectangle(new GREATLib.Rect(0, 0, screenService.GameWindowSize.X, screenService.GameWindowSize.Y), Color.Red); RedRectangle.Alpha = 0f; AddChild(RedRectangle); DrawableLabel deathMessage = new DrawableLabel(); deathMessage.Text = "You died!"; deathMessage.Scale = new Vector2(2f); deathMessage.RelativeOrigin = new Vector2(0.5f); deathMessage.SetPositionInScreenPercent(50, 40); AddChild(deathMessage, 2); DeathTimer = new DrawableLabel(); DeathTimer.Text = DeathDuration.Seconds.ToString(); DeathTimer.Scale = new Vector2(2f); DeathTimer.RelativeOrigin = new Vector2(0.5f); DeathTimer.SetPositionInScreenPercent(50, 50); AddChild(DeathTimer, 2); }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { base.OnLoad(content, gd); // Add the gear and smoke. if (Structure.Team == Teams.Left) { AddChild(new DrawableImage(LEFT_IMAGE) { RelativeOrigin = new Vector2(0.5f, 1.0f) }, 2); DrawableImage gear = new DrawableImage("MapObjects/gearnexus") { RelativeOrigin = new Vector2(0.5f), Position = new Vector2(-70, -85) }; AddChild(gear); gear.PerformAction(new ActionSequence(ActionSequence.INFINITE_SEQUENCE, new ActionRotateBy(new TimeSpan(0, 0, 1), 20, false))); AddChild(new SmokeSystem() { Position = new Vector2(-80, -180) }); AddChild(new SmokeSystem() { Position = new Vector2(-13, -160) }); } else { AddChild(new DrawableImage(RIGHT_IMAGE) { RelativeOrigin = new Vector2(0.5f, 1f), Position = new Vector2(5, 5) }, 3); AddChild(Diamond = new DrawableImage("MapObjects/rbaseDiamond") { RelativeOrigin = new Vector2(0.5f, 1f), Position = new Vector2(5, -25) }, 2); } //Add the life bar AddChild(LifeBar, 3); }
public override void draw(Microsoft.Xna.Framework.Graphics.GraphicsDevice _GraphicsDevice, Microsoft.Xna.Framework.Graphics.SpriteBatch _SpriteBatch) { _SpriteBatch.Begin(); base.draw(_GraphicsDevice, _SpriteBatch); _SpriteBatch.End(); }