protected override void DrawChildren(SpriteBatch spriteBatch)
        {
            if (!Terraria3D.Enabled)
            {
                return;
            }
            if (!Main.playerInventory && !InputTerraria3D.CameraControlsEnabled)
            {
                return;
            }

            if (InputTerraria3D.CameraControlsEnabled)
            {
                _controlsPanel.Draw(spriteBatch);
                _toggleControlsPanelButton.Draw(spriteBatch);
            }
            _editCameraIcon.Draw(spriteBatch);
            if (_editCameraIcon.ContainsPoint(Main.MouseScreen))
            {
                _editCameraHoverTip.Draw(spriteBatch);
            }
        }
Exemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            if (Main.LocalPlayer.dead)
            {
                Visible = false;
            }

            horizontalScale = Main.screenWidth / 1920f;
            verticalScale   = Main.screenHeight / 1017f;

            // Cookbook texture alignment
            //cookbookSkin.ImageScale = horizontalScale;
            //Main.NewText(cookbookSkin.Width.Pixels + " " + cookbookSkin.Height.Pixels);
            //cookbookSkin.Width.Pixels = 1358;// * horizontalScale;
            //cookbookSkin.Height.Pixels = 622;// * verticalScale;
            cookbookSkin.Left.Pixels = (Main.screenWidth / 2 - cookbookSkin.Width.Pixels / 2);  // * horizontalScale;
            //cookbookSkin.Left.Pixels = (1920 / 2 - cookbookSkin.Width.Pixels / 2);// * horizontalScale;
            cookbookSkin.Top.Pixels = (Main.screenHeight / 2 - cookbookSkin.Height.Pixels / 2); // * verticalScale;
            //cookbookSkin.Top.Pixels = (1017 / 2 - cookbookSkin.Height.Pixels / 2);// * verticalScale;
            //cookbookSkin.ImageScale = horizontalScale;
            //Main.NewText($"{cookbookSkin.Width.Pixels}, {cookbookSkin.Height.Pixels}");


            // Tabs alignment
            //tabs.HAlign = 1.1f;
            //tabs.Left.Pixels = Main.screenWidth * 0.62f;
            //Main.NewText(1358 * horizontalScale);
            //tabs.VAlign = 0.5f;
            //tabs.Width.Pixels = 300 * horizontalScale;
            //tabs.Height.Pixels = cookbookSkin.Height.Pixels;// * verticalScale;
            //tabs.Height.Pixels = cookbookSkin.Width.Pixels * 2;

            test.Width  = tabs.Width;
            test.Height = tabs.Height;

            /*cookbookSkin.ImageScale = horizontalScale;
             * cookbookSkin.Height.Pixels = 622 * verticalScale;
             * cookbookSkin.Width.Pixels = 1358 * horizontalScale;
             * cookbookSkin.HAlign = 0;
             * cookbookSkin.VAlign = 0;
             * cookbookSkin.Left.Pixels = 0;
             * cookbookSkin.Top.Pixels = 0;*/

            // baseLayer.RemoveChild(cookbookSkin);
            //baseLayer.Append(cookbookSkin);
            //Main.NewText(Main.screenWidth + " : " + Main.screenHeight);
            //cookbookSkin.Left.Pixels = baseLayer.Width.Pixels/2;
            //cookbookSkin.Top.Pixels = baseLayer.Height.Pixels/2;
            //cookbookSkin.Height.Pixels = 648 * verticalScale;
            //cookbookSkin.Width.Pixels = 1358 * horizontalScale;

            //HandyNotes.ImageScale = verticalScale;
            //RandomNotes.ImageScale = verticalScale;
            //ResourcefulNotes.ImageScale = verticalScale;
            //SafetyNotes.ImageScale = verticalScale;
            //UtilityNotes.ImageScale = verticalScale;

            /*HandyNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 1),0);
             * RandomNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 3),0);
             * ResourcefulNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 5),0);
             * SafetyNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 7),0);
             * UtilityNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 9),0);*/

            HandyNotes.VAlign       = 1 / 6f;
            RandomNotes.VAlign      = 2 / 6f;
            ResourcefulNotes.VAlign = 3 / 6f;
            SafetyNotes.VAlign      = 4 / 6f;
            UtilityNotes.VAlign     = 5 / 6f;

            if (!originalDrawUpdate)
            {
                originalDrawUpdate = true;
                cookbookSkin.RemoveAllChildren();
                cookbookSkin.Append(handyNotesPages);
                cookbookSkin.Append(tabs);
                handyNotesPages.MakeVisible();
            }


            //tabs.Left.Pixels = cookbookSkin.Width.Pixels - 180;

            if (Main.playerInventory)
            {
                Visible = false;
            }

            if (!Visible)
            {
                ButtonUI.Visible = true;
            }

            if (cookbookSkin.ContainsPoint(Main.MouseScreen) && Visible)
            {
                Main.LocalPlayer.mouseInterface = true;
            }


            base.Update(gameTime);
        }