Beispiel #1
0
        protected override void LoadContent()
        {
            _textures = new Texture2DCache(typeof(Textures));

            _spriteBatch = new SpriteBatch(Globals.GraphicsDevice);

            _markerAnchor_Blue            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Blue], new Vector2(4, 4));
            _markerAnchor_Blue.LayerDepth = 0;
            _renderParamsTemplate.GetTexture_MarkCenter = new Getter <ISprite>(() => { return(_markerAnchor_Blue); });

            _markerTopLeft_Red            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Red], new Vector2(4, 4));
            _markerTopLeft_Red.LayerDepth = 0;
            _renderParamsTemplate.GetTexture_MarkOrigin = new Getter <ISprite>(() => { return(_markerTopLeft_Red); });

            _markerCompositeAnchor_Green                 = StaticSprite.Acquire(_textures[(int)Textures.Marker_Green], new Vector2(4, 4));
            _markerCompositeAnchor_Green.LayerDepth      = 0;
            _renderParamsTemplate.GetTexture_MarkTopLeft = new Getter <ISprite>(() => { return(_markerCompositeAnchor_Green); });

            List <Vector2> vertices = new List <Vector2>();

            vertices.Add(new Vector2(100, 100));
            vertices.Add(new Vector2(150, 50));
            vertices.Add(new Vector2(200, 100));
            vertices.Add(new Vector2(120, 120));

            _polygon = new PolygonExtent();
            _polygon.Reset(vertices);
            _polygon.ReAnchor(_polygon.ActualCenter);

            _contentLoaded = true;
        }
Beispiel #2
0
        protected override void LoadContent()
        {
            _textures = new Texture2DCache(typeof(Textures));

            _spriteBatch       = new SpriteBatch(Globals.GraphicsDevice);
            _child1            = StaticSprite.Acquire(_textures[(int)Textures.ColoredRect], new Vector2(100, 100));
            _child1.LayerDepth = 1;

            _child2 = StaticSprite.Acquire(_textures[(int)Textures.GrayRect], new Vector2(25, 50));
            _child2.RenderingExtent.Anchor = new Vector2(250, 250);
            _child2.LayerDepth             = 1;

            _markerAnchor_Blue            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Blue], new Vector2(4, 4));
            _markerAnchor_Blue.LayerDepth = 0;
            _renderParamsTemplate.GetTexture_MarkCenter = new Getter <ISprite>(() => { return(_markerAnchor_Blue); });

            _markerTopLeft_Red            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Red], new Vector2(4, 4));
            _markerTopLeft_Red.LayerDepth = 0;
            _renderParamsTemplate.GetTexture_MarkOrigin = new Getter <ISprite>(() => { return(_markerTopLeft_Red); });

            _markerCompositeAnchor_Green                 = StaticSprite.Acquire(_textures[(int)Textures.Marker_Green], new Vector2(4, 4));
            _markerCompositeAnchor_Green.LayerDepth      = 0;
            _renderParamsTemplate.GetTexture_MarkTopLeft = new Getter <ISprite>(() => { return(_markerCompositeAnchor_Green); });

            _compositeExtent = new CompositeExtent();
            _compositeExtent.Add(_child1.RenderingExtent);
            _compositeExtent.Add(_child2.RenderingExtent);

            _contentLoaded = true;
        }
Beispiel #3
0
        protected override void LoadContent()
        {
            _textures    = new Texture2DCache(typeof(Textures));
            _spriteBatch = new SpriteBatch(Globals.GraphicsDevice);

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    var sprite = StaticSprite.Acquire(_textures[(int)Textures.ColoredRect]);
                    sprite.LayerDepth             = 1;
                    sprite.RenderingExtent.Anchor = new Vector2(100 + i * 250, 100 + j * 250);
                    _sprites.Add(sprite);
                }
            }

            _viewportCenter            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Red], new Vector2(4, 4));
            _viewportCenter.LayerDepth = 0;
            _sprites.Add(_viewportCenter);

            ScreenUtility.InitGraphicsMode(800, 480, false);

            _viewport.ResetWithScreenSize(800, 480);

            _contentLoaded = true;
        }
Beispiel #4
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(Globals.GraphicsDevice);
            _textures    = new Texture2DCache(typeof(Textures));
            _spriteRed   = StaticSprite.Acquire(_textures[(int)Textures.RectRedVertical]);

            _spriteRed.LayerDepth  = 0; //front
            _spriteBlue            = StaticSprite.Acquire(_textures[(int)Textures.RectBlueHorizontal]);
            _spriteBlue.LayerDepth = 1; //back
        }
Beispiel #5
0
        protected override void LoadContent()
        {
            _textures = new Texture2DCache(typeof(Textures));

            _spriteBatch       = new SpriteBatch(Globals.GraphicsDevice);
            _sprite            = StaticSprite.Acquire(_textures[(int)Textures.ColoredRect], new Vector2(100, 100));
            _sprite.LayerDepth = 1;

            _markerAnchor_Blue            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Blue], new Vector2(4, 4));
            _markerAnchor_Blue.LayerDepth = 0;

            _markerTopLeft_Red            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Red], new Vector2(4, 4));
            _markerTopLeft_Red.LayerDepth = 0;
        }
Beispiel #6
0
        protected override void LoadContent()
        {
            _textures = new Texture2DCache(typeof(Textures));

            _spriteBatch = new SpriteBatch(Globals.GraphicsDevice);
            _fonts       = new SpriteFontCache(typeof(Fonts));

            _markerIntersect_Blue            = StaticSprite.Acquire(_textures[(int)Textures.Marker_Blue], new Vector2(4, 4));
            _markerIntersect_Blue.LayerDepth = 0;

            _markerPoint_Red                        = StaticSprite.Acquire(_textures[(int)Textures.Marker_Red], new Vector2(4, 4));
            _markerPoint_Red.LayerDepth             = 0;
            _markerPoint_Red.RenderingExtent.Anchor = new Vector2(_xValue, _yValue);

            var vertices = new List <Vector2>();

            vertices.Add(new Vector2(22, 122));
            vertices.Add(new Vector2(66, 23));
            vertices.Add(new Vector2(150, 5));
            vertices.Add(new Vector2(293, 78));
            vertices.Add(new Vector2(256, 194));
            vertices.Add(new Vector2(230, 86));
            vertices.Add(new Vector2(202, 175));
            vertices.Add(new Vector2(113, 157));
            vertices.Add(new Vector2(168, 69));
            vertices.Add(new Vector2(165, 148));
            vertices.Add(new Vector2(203, 60));
            vertices.Add(new Vector2(105, 50));
            vertices.Add(new Vector2(77, 140));
            vertices.Add(new Vector2(40, 147));

            _insidePolygon = XenString.Acquire();
            _insidePolygon.Reset(_fonts[(int)Fonts.Arial], "Inside!");

            _polygonExtent = new PolygonExtent();
            _polygonExtent.Reset(vertices);
        }