bool updateFullScreen(int width, int height)
        {
            if (io != null)
            {
                // main screen
                BrailleIOScreen fullScreen = io.GetView(BS_FULLSCREEN_NAME) as BrailleIOScreen;
                if (fullScreen != null)
                {
                    fullScreen.SetHeight(height);
                    fullScreen.SetWidth(width);

                    // center
                    BrailleIOViewRange center = fullScreen.GetViewRange(VR_CENTER_NAME);
                    if (center != null)
                    {
                        center.SetHeight(height);
                        center.SetWidth(width);
                    }

                    io.RefreshDisplay(true);
                    return(true);
                }
            }
            return(false);
        }
Beispiel #2
0
 public override void Resize(int width, int height)
 {
     title.SetLeft(2);
     title.SetTop(2);
     title.SetWidth(width - 4);
     title.SetHeight(width - 4);
     title.SetText(ll.GetTrans("game.title") + "\n" + ll.GetTrans("game.keybindings1") + "\n" + ll.GetTrans("game.keybindings2") + "\n" + ll.GetTrans("game.keybindings3") + "\n" + ll.GetTrans("game.keybindings4"));
 }
        BrailleIOViewRange getMainTopRegion(int left, int top, int width, int height)
        {
            BrailleIOViewRange _top = new BrailleIOViewRange(left, top, width, height);

            _top.SetBorder(0, 0, 1);
            _top.SetMargin(0, 0, 1);
            _top.SetPadding(0, 11, 1, 0);
            _top.SetWidth((int)(width * 1.4)); // only that region content is not doing line breaks
            return(_top);
        }
        bool updateMainScreen(int width, int height)
        {
            if (io != null)
            {
                // main screen
                BrailleIOScreen mainScreen = io.GetView(BS_MAIN_NAME) as BrailleIOScreen;
                if (mainScreen != null)
                {
                    mainScreen.SetHeight(height);
                    mainScreen.SetWidth(width);

                    // center
                    BrailleIOViewRange center = mainScreen.GetViewRange(VR_CENTER_NAME);
                    if (center != null)
                    {
                        center.SetHeight(height);
                        center.SetWidth(width);
                    }

                    // center 2
                    BrailleIOViewRange center2 = mainScreen.GetViewRange(VR_CENTER_2_NAME);
                    if (center2 != null)
                    {
                        center2.SetHeight(height);
                        center2.SetWidth(width);
                    }

                    //top
                    BrailleIOViewRange top = mainScreen.GetViewRange(VR_TOP_NAME);
                    if (top != null)
                    {
                        top.SetWidth((int)(width * 1.4)); // only that region content is not doing line breaks
                    }

                    // status
                    BrailleIOViewRange status = mainScreen.GetViewRange(VR_STATUS_NAME);
                    if (status != null)
                    {
                        status.SetLeft(width - 12);
                    }

                    // center 2
                    BrailleIOViewRange detail = mainScreen.GetViewRange(VR_DETAIL_NAME);
                    if (detail != null)
                    {
                        detail.SetTop(height - 7);
                        detail.SetWidth(width);
                    }

                    io.RefreshDisplay(true);
                    return(true);
                }
            }
            return(false);
        }
Beispiel #5
0
        /// <summary>
        /// Builds a dummy view range with the same size as the image.
        /// </summary>
        /// <param name="img">The image.</param>
        /// <returns>A dummy view range with the size of the image.</returns>
        private static IViewBoxModel buildImageDummyViewRange(Image img)
        {
            BrailleIOViewRange view = new BrailleIOViewRange(0, 0, 0, 0);

            if (img != null)
            {
                view.SetWidth(img.Width);
                view.SetHeight(img.Height);
            }
            return(view);
        }
Beispiel #6
0
        /// <summary>
        /// Resizes the screen
        /// </summary>
        /// <param name="width">The new width</param>
        /// <param name="height">The new height</param>
        public override void Resize(int width, int height)
        {
            this.SetWidth(width);
            this.SetHeight(height);

            mainRegion.SetWidth(width);
            mainRegion.SetHeight(height);

            detailRegion.SetWidth(width);
            detailRegion.SetHeight(height);
        }
 BrailleIOViewRange getMainTopRegion(int left, int top, int width, int height)
 {
     BrailleIOViewRange _top = new BrailleIOViewRange(left, top, width, height);
     _top.SetBorder(0, 0, 1);
     _top.SetMargin(0, 0, 1);
     _top.SetPadding(0, 11, 1, 0);
     _top.SetWidth((int)(width * 1.4)); // only that region content is not doing line breaks
     return _top;
 }