private void NextViewportPolicy() { #if !PLATFORM_XBOX this.policy = (Renderer.ViewportPolicy)((int)(this.policy + 1) % Enum.GetNames(typeof(Renderer.ViewportPolicy)).Length); Trace.WriteLine("Changed ViewportPolicy to: " + this.policy); this.renderer.ChangeOptions(this.policy, this.renderOptions); #endif }
public DebugLayer(float defaultLineWidth, Renderer.ViewportPolicy viewportPolicy, SpriteFont font) : base(new Renderer(1, viewportPolicy, Renderer.RenderOptions.Canvas)) { this.defaultLineWidth = defaultLineWidth; this.font = font; this.Color = new Dictionary <string, Color>(StringComparer.OrdinalIgnoreCase); this.entityVectors = new Dictionary <Entity, Dictionary <string, Vector2> >(); this.entityLabels = new Dictionary <Entity, Dictionary <string, EntityLabel> >(); }
public TouchController(Renderer.ViewportPolicy viewportPolicy = Renderer.ViewportPolicy.None) { this.ViewportPolicy = viewportPolicy; previousMouse = Mouse.GetState(); #if PLATFORM_WINDOWS this.touchCollection = new TouchCollection(); #else this.touchCollection = TouchPanel.GetState(); #endif }
public RendererCanvasTest(Renderer renderer, SpriteFont font) { this.renderer = renderer; this.renderOptions = renderer.Options | Renderer.RenderOptions.Canvas; this.policy = default(Renderer.ViewportPolicy); this.renderer.ChangeOptions(this.policy, this.renderOptions); this.font = font; this.timer = 0; this.resolutionIndex = 0; this.keyboard = Keyboard.GetState(); this.GenerateColors(); }
public override void OnAncestryChanged() { this.touch = PhantomGame.Game.GetComponentByType <TouchController> (); if (this.touch == null) { Renderer.ViewportPolicy p = Renderer.ViewportPolicy.None; Renderer r = layer.GetComponentByType <Renderer> (); if (r != null) { p = r.Policy; } PhantomGame.Game.AddComponent(this.touch = new TouchController(p)); } base.OnAncestryChanged(); }
private void NextViewportPolicy() { #if !XBOX this.policy = (Renderer.ViewportPolicy)((int)(this.policy + 1) % Enum.GetNames(typeof(Renderer.ViewportPolicy)).Length); Trace.WriteLine("Changed ViewportPolicy to: " + this.policy); this.renderer.ChangeOptions(this.policy, this.renderOptions); #endif }
public static void AddDebugLayer(this GameState state, float defaultLineWidth, Renderer.ViewportPolicy viewportPolicy, SpriteFont font) { state.AddComponent(new DebugLayer(defaultLineWidth, viewportPolicy, font)); }