public override void OnStart()
        {
            System.Random rand = new Random(GlobalData.Seed);
            //transform.Position = new Vector3(rand.Next(-100,100), 30, rand.Next(-100, 100));
            transform.Position = new Vector3(0, 30, 0);
#if Client
            if (isMine)
            {
                PlayerPosition = new GUILable("No Player Data", new System.Drawing.Rectangle(5, 50, 200, 20), ProjectEvlly.src.UI.UIDock.TopLeft);
                PlayerPosition.SetColor(Color4.White);
                PlayerPosition.SetTextAling(ProjectEvlly.src.UI.Font.TextAling.Left);
                PlayerPosition.ShowBackGround = false;

                BlockInfo = new GUILable("No Player Data", new System.Drawing.Rectangle(5, 70, 200, 20), ProjectEvlly.src.UI.UIDock.TopLeft);
                BlockInfo.SetColor(Color4.White);
                BlockInfo.SetTextAling(ProjectEvlly.src.UI.Font.TextAling.Left);
                BlockInfo.ShowBackGround = false;


                renderMesh        = false;
                _playerController = new PlayerController(this, 0.5f);//Start the player controller, only if you own this entity(if you spawened this)

                /*_MeshRenderSword = new MeshRender(Camera.Main._transformParent, AssetsManager.GetMesh("SwordMetal"), AssetsManager.GetShader("Default"), AssetsManager.GetTexture("MetalSword"));
                 * RenderSystem.AddRenderItem(_MeshRenderSword);*/
            }
            //_MeshRender = new MeshRender(transform, AssetsManager.GetMesh("Cube"), AssetsManager.GetShader("Default"), AssetsManager.GetTexture("devTexture"));
            //RenderSystem.AddRenderItem(_MeshRender);
#elif Server
#endif

            base.OnStart();
        }
Beispiel #2
0
        public GUIButton(GameObject obj, System.Func<bool> enableChecker)
        {
            m_button = obj.GetComponent<Button>();
            m_lable = new GUILable(obj.transform.Find("Text").gameObject);
            m_enableChecker = enableChecker;

            Transform iconTrans = obj.transform.Find("Icon");
            if (iconTrans != null)
            {
                RawImage rawImage = iconTrans.GetComponent<RawImage>();
                m_icon = new GUIImageStatic(iconTrans.gameObject, rawImage.texture);
            }
        }
        private void CreateLoadingScreen()
        {
            connectionBackgorund             = new GUIImage(new System.Drawing.Rectangle(0, 0, 0, 0), UIDock.ScreenSizeRatio);
            connectionBackgorund.TextureName = "BackGround";
            connectionBackgorund.NoInteractable();
            connectionBackgorund.Disable();

            connectionTextInfo = new GUILable("Null Connection Screen Info", new System.Drawing.Rectangle(0, 0, 200, 20), UIDock.Cennter);
            connectionTextInfo.SetColor(Color4.White);
            connectionTextInfo.SetTextAling(Font.TextAling.Center);
            connectionTextInfo.ShowBackGround = false;
            connectionTextInfo.Disable();
        }
        public GUIMainMenu(Client cli)
        {
            _Client = cli;

            System.Random rand = new Random();

            imgteste             = new GUIImage(new System.Drawing.Rectangle(0, 0, 0, 0), UIDock.ScreenSizeRatio);
            imgteste.TextureName = "BackGround";
            imgteste.NoInteractable();
            imgteste.SetBackColors(new Color4(102, 70, 36, 255), Color4.White, Color4.White, Color4.White);
            imgteste.SetInteractColor(new Color4(102, 70, 36, 255));

            Logo             = new GUIImage(new System.Drawing.Rectangle(0, 135, 350, 50), UIDock.Cennter);
            Logo.TextureName = "VaKLogoYellow";
            Logo.SetBackColors(Color4.White, Color4.White, Color4.White, Color4.White);
            Logo.NoInteractable();
            Logo.SetInteractColor(Color4.White);

            PlaySingleButtom = new GUIButtom("SinglePlayer", new System.Drawing.Rectangle(0, 55, 200, 50), UIDock.Cennter);
            PlaySingleButtom.SetColor(Color4.White);
            PlaySingleButtom.SetBackColors(Color4.White, Color4.Gray, Color4.Gray, Color4.White);
            PlaySingleButtom.TextureName = "Buttom";
            PlaySingleButtom.OnClick    += PlayButtomClick;

            PlayMultiButtom = new GUIButtom("MultiPlayer", new System.Drawing.Rectangle(0, 0, 200, 50), UIDock.Cennter);
            PlayMultiButtom.SetColor(Color4.White);
            PlayMultiButtom.TextureName = "Buttom";
            PlayMultiButtom.OnClick    += PlayMButtomClick;

            QuitButtom = new GUIButtom("Quit", new System.Drawing.Rectangle(0, -55, 200, 50), UIDock.Cennter);
            QuitButtom.SetColor(Color4.White);
            QuitButtom.TextureName = "Buttom";
            QuitButtom.OnClick    += QuitButtomClick;

            VersionText = new GUILable(GlobalData.AppName + " " + GlobalData.Version, new System.Drawing.Rectangle(5, 5, 200, 20), UIDock.TopLeft);
            VersionText.SetColor(Color4.White);
            VersionText.SetTextAling(Font.TextAling.Left);
            VersionText.ShowBackGround = false;

            debugText = new GUILable("", new System.Drawing.Rectangle(5, 30, 200, 20), UIDock.TopLeft);
            debugText.SetColor(Color4.White);
            debugText.SetTextAling(Font.TextAling.Left);
            debugText.ShowBackGround = false;

            DarkcomsoftCopy = new GUILable("Copyright(c) 2020 Darkcomsoft - All rights reserved.", new System.Drawing.Rectangle(5, 5, 200, 20), UIDock.BottomLeft);
            DarkcomsoftCopy.SetColor(Color4.White);
            DarkcomsoftCopy.SetTextAling(Font.TextAling.Left);
            DarkcomsoftCopy.ShowBackGround = false;

            CreateLoadingScreen();
        }
Beispiel #5
0
        public GameUI()
        {
            _PrepareGUI = new PrepareGUI(this);

            VersionText = new GUILable(GlobalData.AppName + " " + GlobalData.Version, new System.Drawing.Rectangle(5, 5, 200, 20), UIDock.TopLeft);
            VersionText.SetColor(Color4.White);
            VersionText.SetTextAling(Font.TextAling.Left);
            VersionText.ShowBackGround = false;

            debugText = new GUILable("Null", new System.Drawing.Rectangle(5, 30, 200, 20), UIDock.TopLeft);
            debugText.SetColor(Color4.White);
            debugText.SetTextAling(Font.TextAling.Left);
            debugText.ShowBackGround = false;

            inGameTollTip = new InGameTollTip();

            //Add Gui Instances here
            GuiList.Add("PauseMenu", new PauseMenu());
        }
        public CharGuiItem(CharSaveInfo charInfo, int index)
        {
            CharIndex = index;
            _CharName = charInfo.CharName;

            ItemBack = new GUIPanel(new System.Drawing.Rectangle(0, 0 + -index * 50 + 520, 505, 50), UIDock.CenterBottom);
            ItemBack.SetBackColors(new Color4(0, 0, 0, 0.2f), new Color4(0, 0, 0, 0.3f), new Color4(0, 0, 0, 0.5f), new Color4(1, 1, 1, 0.2f));
            ItemBack.Interactable();
            ItemBack.OnClick += onClcik;

            ItemBackSelect = new GUIPanel(new System.Drawing.Rectangle(0, 0 + -index * 50 + 520, 505, 50), UIDock.CenterBottom);
            ItemBackSelect.SetBackColors(new Color4(1, 1, 1, 0.2f), new Color4(1, 1, 1, 0.3f), new Color4(1, 1, 1, 0.5f), new Color4(1, 1, 1, 0.2f));
            ItemBackSelect.Interactable();
            ItemBackSelect.Disable();

            CharName = new GUILable(_CharName + " I:" + index, new System.Drawing.Rectangle(0, 0 + -index * 50 + 520, 505, 50), UIDock.CenterBottom);
            CharName.SetTextAling(Font.TextAling.Left);
            CharName.SetColor(Color4.White);
            CharName.SetBackColors(Color4.White, Color4.Gray, Color4.Gray, Color4.White);
            CharName.ShowBackGround = false;
            CharName.NoInteractable();
        }
Beispiel #7
0
        public GUIImageStatic(GameObject obj, Texture icon)
        {
            m_image = obj.GetComponent<RawImage>();
            m_image.texture = icon;

            m_lable = new GUILable(obj.transform.Find("Text").gameObject);
        }
Beispiel #8
0
        public GUIImageDynamic(GameObject parent, Texture icon)
        {
            GameObject guiImageObj = GameObject.Instantiate(Resources.Load<GameObject>("Pref/GUIImage")) as GameObject;
            m_image = guiImageObj.GetComponent<RawImage>();
            m_image.texture = icon;

            m_lable = new GUILable(m_image.transform.Find("Text").gameObject);

            guiImageObj.transform.parent = parent.transform;
            guiImageObj.transform.localPosition = Vector3.zero;
            guiImageObj.transform.localScale = Vector3.one;
        }
Beispiel #9
0
 public GUIGuage(GameObject obj, System.Func<float>	fillAmountGetter, System.Func<string> lableGetter)
 {
     m_guage = obj.GetComponent<Image>();
     m_text = new GUILable(obj.transform.Find("Text").gameObject);
     m_fillAmountGetter = fillAmountGetter;
     m_lableGetter = lableGetter;
 }
 public InGameTollTip()
 {
     texttest = new GUILable("TollTip: ", new System.Drawing.Rectangle(Window.Instance.Width / 2, Window.Instance.Height / 2, 100, 50), UIDock.Free);
     texttest.Disable();
 }