public FloorTool(IsometricView parentView, int floorIdx)
            : base(parentView)
        {
            myCanChangePosition = true;
            myCanRotate = false;
            myCanZoom = false;

            myFloorIndex = floorIdx;
        }
Example #2
0
        public override void DrawForPicking(IsometricView.SetPickingPixel setPixelDelegate, ushort UId)
        {
            Texture2D tex = GetCurrentTexture();
            Microsoft.Xna.Framework.Graphics.Color[] newTex = new Microsoft.Xna.Framework.Graphics.Color[tex.Width * tex.Height];
            tex.GetData<Microsoft.Xna.Framework.Graphics.Color>(newTex);

            int x_pos = ScreenPosition[0] + GameObject.GlobalXTranslation;
            int y_pos = ScreenPosition[1] + GameObject.GlobalYTranslation;

            for (int y = 0; y < tex.Height; y++)
            {
                for (int x = 0; x < tex.Width; x++)
                {
                    int i = tex.Width * y + x;

                    if (x_pos + x < 800 && y_pos + y < 600 && x_pos + x >= 0 && y_pos + y >= 0)
                    {
                        if (newTex[i].A != 0)
                        {
                            Microsoft.Xna.Framework.Graphics.Color c = new Microsoft.Xna.Framework.Graphics.Color((byte)myPosition[0], (byte)myPosition[1], (byte)(UId & 0xFF), (byte)(UId >> 8));
                            setPixelDelegate(c, x_pos + x, y_pos + y);
                        }
                        else
                        {
                            Microsoft.Xna.Framework.Graphics.Color c = new Microsoft.Xna.Framework.Graphics.Color(255, 255, 0, 0);
                            setPixelDelegate(c, x_pos + x, y_pos + y);
                        }
                    }
                }
            }
        }
Example #3
0
        public override void DrawForPicking(IsometricView.SetPickingPixel setPixelDelegate, ushort UId)
        {
            int x_pos = ScreenPosition[0] + GameObject.GlobalXTranslation;
            int y_pos = ScreenPosition[1] + GameObject.GlobalYTranslation;

            x_pos -= Width;
            y_pos -= Height / 4;

            if (x_pos + Width < 0 || x_pos > 800 || y_pos + Height > 600 || y_pos < 0)
                return;

            Texture2D tex = myFloorLods[DrawSize];
            Microsoft.Xna.Framework.Graphics.Color[] newTex = new Microsoft.Xna.Framework.Graphics.Color[tex.Width * tex.Height];
            tex.GetData<Microsoft.Xna.Framework.Graphics.Color>(newTex);

            for (int y = tex.Height - 1; y >= 0; y--)
            {
                for (int x = 0; x < tex.Width; x++)
                {
                    int i = tex.Width * y + x;

                    if (x_pos + x < 800 && y_pos + y < 600 && x_pos + x >= 0 && y_pos + y >= 0)
                    {
                        if (newTex[i].A != 0)
                        {
                            Microsoft.Xna.Framework.Graphics.Color c = new Microsoft.Xna.Framework.Graphics.Color((byte)myPosition[0], (byte)myPosition[1], (byte)(UId & 0xFF), (byte)(UId >> 8));
                            setPixelDelegate(c, x_pos + x, y_pos + y);
                        }
                        else
                        {
                            Microsoft.Xna.Framework.Graphics.Color c = new Microsoft.Xna.Framework.Graphics.Color(255, 255, 0, 0);
                            setPixelDelegate(c, x_pos + x, y_pos + y);
                        }
                    }
                }
            }
        }
 public BuyBuildTool(IsometricView parentView)
 {
     myParentView = parentView;
 }