Esempio n. 1
0
        // Todo: Should be on Extension class as Extension Method
        public RectangleElement AddRectangle(float x, float y, float width, float height, int lineWidth, Color color)
        {
            var rectangleElement = new RectangleElement(x, y, width, height, lineWidth, color);
            this.elements.Add(rectangleElement);

            return rectangleElement;
        }
Esempio n. 2
0
        protected override Scene CreateScene()
        {
            var scene = new Scene("HubScene");
            scene.Add(new ColorLayer("Background", Color.CornflowerBlue));

            var font = this.ResourceManager.GetDrawingFont(@"Sandbox\SpriteFont1");

            var hubMap = new DrawingLayer("HubMap");

            this.sandboxRectangle = hubMap.AddRectangle(10, 10, 200, 200, 1, Color.White);
            this.shootEmUpRectangle = hubMap.AddRectangle(220, 10, 200, 200, 1, Color.White);
            this.tiledRectangle = hubMap.AddRectangle(10, 230, 200, 200, 1, Color.White);
            this.touchRectangle = hubMap.AddRectangle(220, 230, 200, 200, 1, Color.White);
            //hubMap.AddRectangle(10, 230, 200, 200, 1, Color.White);
            //hubMap.AddRectangle(220, 230, 200, 200, 1, Color.White);

            hubMap.AddText(font, "1 - Sandbox sample", new Vector(20, 210), Color.White);
            hubMap.AddText(font, "2 - ShootEmUp sample", new Vector(220, 210), Color.White);
            hubMap.AddText(font, "3 - Tiled sample", new Vector(20, 430), Color.White);
            hubMap.AddText(font, "4 - Touch sample", new Vector(220, 430), Color.White);

            scene.Add(hubMap);

            scene.Add(new MouseCursor(this.InputConfiguration.CreateMouseTracking(this.Camera)));

            return scene;
        }
Esempio n. 3
0
        private DrawingLayer CreateButtonLayer()
        {
            var font = this.ResourceManager.GetDrawingFont(@"Sandbox\SpriteFont1");

            var drawingMap = new DrawingLayer("Button");

            this.visualBackButtonElement = drawingMap.AddRectangle(this.visualBackButton.Rectangle, 2, Color.Blue);
            drawingMap.AddText(font, "Back", this.visualBackButton.Rectangle.Location.Translate(10, 10), Color.White);

            return drawingMap;
        }
Esempio n. 4
0
 public RectangleHit(RectangleElement rectangleElement)
 {
     this.RectangleElement = rectangleElement;
 }
Esempio n. 5
0
        public RectangleElement AddRectangle(Rectangle rectangle, int lineWidth, Color color)
        {
            var rectangleElement = new RectangleElement(rectangle, lineWidth, color);
            this.elements.Add(rectangleElement);

            return rectangleElement;
        }