コード例 #1
0
ファイル: StartScreen.cs プロジェクト: holycrab13/TactileGame
 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"));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        // TODO: correct toggle function for active detail area view range
        private void toggleFullDetailScreen()
        {
            BrailleIOScreen    vs       = GetVisibleScreen();
            BrailleIOViewRange detailVR = vs.GetViewRange(VR_DETAIL_NAME); // TODO: ImageData class creates own detail area --> do not use global detailarea
            BrailleIOViewRange topVR    = vs.GetViewRange(VR_TOP_NAME);

            detailVR.SetHeight(deviceSize.Height - topVR.GetHeight());
            detailVR.SetTop(topVR.GetHeight() - 3);
            io.RefreshDisplay();
            audioRenderer.PlaySoundImmediately(LL.GetTrans("tangram.lector.wm.views.detail_maximize"));
        }