示例#1
0
        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
        }
示例#2
0
 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> >();
 }
示例#3
0
        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
        }
示例#4
0
        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();
        }
示例#5
0
        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();
        }
示例#6
0
 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();
 }
示例#7
0
 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
 }
示例#8
0
 public static void AddDebugLayer(this GameState state, float defaultLineWidth, Renderer.ViewportPolicy viewportPolicy, SpriteFont font)
 {
     state.AddComponent(new DebugLayer(defaultLineWidth, viewportPolicy, font));
 }