Beispiel #1
0
        public Boat(XmlNode node, float scale)
        {
            Container          = new FlagContainer();
            Container.DrawMode = DrawMode.TopLeft;

            containerOffset = new Point((int)(int.Parse(node["flagX"].InnerText) * scale), (int)(int.Parse(node["flagY"].InnerText) * scale));
            numberOffset    = new Point((int)(int.Parse(node["numX"].InnerText) * scale), (int)(int.Parse(node["numY"].InnerText) * scale));

            disturbPoint = (int)(int.Parse(node["disturbX"].InnerText) * scale);

            Speed      = float.Parse(node["speed"].InnerText);
            Weight     = (int)(int.Parse(node["watersink"].InnerText) * scale);
            FlagHeight = (int)(int.Parse(node["flagHeight"].InnerText) * scale);

            image = (Image)Properties.Resources.ResourceManager.GetObject(node["image"].InnerText);

            if (scale != 1)
            {
                image = Util.ResizeImage(image, (int)(image.Width * scale), (int)(image.Height * scale));
            }

            Size = image.Size;

            this.DrawMode = DrawMode.TopLeft;
        }
Beispiel #2
0
        public Boat()
        {
            Container          = new FlagContainer();
            Container.DrawMode = DrawMode.TopLeft;
            this.DrawMode      = DrawMode.TopLeft;


            IndicatorLabel = new TextLabel()
            {
                Font     = new Font("Arial", 20, FontStyle.Bold),
                Color    = Color.White,
                DrawMode = DrawMode.Centered
            };
        }