Example #1
0
    void ScaleGraph(float scale)
    {
        /*
         * Set the axes and labels
         */

        xRange[0] = -scale / 25f;  xRange[1] = scale / 25f;

        yRange[0] = -scale * yx_ratio / 25f;  yRange[1] = scale * yx_ratio / 25f;

        zRange[0] = 0; zRange[1] = 2 * scale * yx_ratio / 25f;

        GameObject.Find("MapImage").transform.localPosition = new Vector3(0, -yx_ratio * scale / 25f, yx_ratio * scale / 25f);
        // For now the Z range = Y range

        XLabel.transform.parent = transform;
        YLabel.transform.parent = transform;
        ZLabel.transform.parent = transform;
        xAxis.transform.parent  = transform;
        yAxis.transform.parent  = transform;
        zAxis.transform.parent  = transform;

        xAxis.transform.localPosition    = new Vector3(0, -yx_ratio * scale / 25f, 0);
        xAxis.transform.localEulerAngles = new Vector3(0, 0, 90);
        xAxis.transform.localScale       = new Vector3(0.05f, scale / 25f, 0.05f);

        yAxis.transform.localPosition = new Vector3(-scale / 25f, 0, 0);
        yAxis.transform.localScale    = new Vector3(0.05f, yx_ratio * scale / 25f, 0.05f);

        zAxis.transform.localPosition    = new Vector3(-scale / 25f, -yx_ratio * scale / 25f, yx_ratio * scale / 25f);
        zAxis.transform.localEulerAngles = new Vector3(90, 0, 0);
        zAxis.transform.localScale       = new Vector3(0.05f, yx_ratio * scale / 25f, 0.05f);

        XLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        XLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;
        YLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        YLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;
        ZLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        ZLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;

        XLabel.transform.localPosition = new Vector3(0, -scale * yx_ratio / 25f - 0.6f, 0);
        YLabel.transform.localPosition = new Vector3(-scale / 25f - 0.9f, 0, 0);
        ZLabel.transform.localPosition = new Vector3(-scale / 25f - 0.9f, -scale * yx_ratio / 25f - 0.4f, scale * yx_ratio / 25f);

        XLabel.transform.localScale = new Vector3(.02f, .02f, .02f);
        YLabel.transform.localScale = new Vector3(.02f, .02f, .02f);
        ZLabel.transform.localScale = new Vector3(.02f, .02f, .02f);
        YLabel.transform.Rotate(new Vector3(0, 0, 90));

        float pointSize = scale / 750f;

        DataPoint0.transform.localScale = new Vector3(pointSize, scale * yx_ratio / 25f, pointSize);
        DataPoint1.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
        DataPoint2.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
    }
Example #2
0
        public void InitZContainer()
        {
            this.btnPlay       = new ZImageButton();
            this.btnPause      = new ZImageButton();
            this.btnStop       = new ZImageButton();
            this.sldProgress   = new ZSlider();
            this.labProgress   = new ZLabel();
            this.btnVolume     = new ZImageButton();
            this.sldVolume     = new ZSlider();
            this.btnFullScreen = new ZImageButton();



            this.btnPlay.BeginInit();
            this.btnPause.BeginInit();
            this.btnStop.BeginInit();
            this.sldProgress.BeginInit();
            this.labProgress.BeginInit();
            this.btnVolume.BeginInit();
            this.sldVolume.BeginInit();
            this.btnFullScreen.BeginInit();

            //
            // btnPlay
            //
            this.btnPlay.Anchor      = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left)));
            this.btnPlay.HoverImage  = Resources.Play;
            this.btnPlay.Location    = new Point(7, 7);
            this.btnPlay.Name        = "btnPlay";
            this.btnPlay.NormalImage = Resources.Play_OnPress;
            this.btnPlay.PressImage  = Resources.Play_OnPress;
            this.btnPlay.Size        = new Size(17, 19);
            this.btnPlay.Click      += new EventHandler(this.btnPlay_Click);
            //
            // btnPause
            //
            this.btnPause.Anchor      = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left)));
            this.btnPause.HoverImage  = Resources.Pause;
            this.btnPause.Location    = new Point(7, 7);
            this.btnPause.Name        = "btnPause";
            this.btnPause.NormalImage = Resources.Pause_OnPress;
            this.btnPause.PressImage  = Resources.Pause_OnPress;
            this.btnPause.Size        = new Size(17, 19);
            this.btnPause.Visible     = false;
            this.btnPause.Click      += new EventHandler(this.btnPause_Click);
            //
            // btnStop
            //
            this.btnStop.Anchor      = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left)));
            this.btnStop.HoverImage  = Resources.Stop;
            this.btnStop.Location    = new Point(29, 9);
            this.btnStop.NormalImage = Resources.Stop_OnPress;
            this.btnStop.PressImage  = Resources.Stop_OnPress;
            this.btnStop.Size        = new Size(15, 15);
            this.btnStop.Click      += new System.EventHandler(this.btnStop_Click);
            //
            // sldProgress
            //
            this.sldProgress.Anchor            = ((AnchorStyles)((AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right)));
            this.sldProgress.DraggerEdgeInset  = new Padding(0);
            this.sldProgress.DraggerSize       = new Size(19, 19);
            this.sldProgress.HoverDraggerImage = Resources.Slider_Dragger;
            this.sldProgress.LoaderEdgeInset   = new Padding(5, 4, 5, 4);
            this.sldProgress.LoaderImage       = Resources.Slider_Loader;
            this.sldProgress.Location          = new Point(50, 6);
            this.sldProgress.Name = "sldProgress";
            this.sldProgress.NormalDraggerImage = Resources.Slider_Dragger_OnPress;
            this.sldProgress.PressDraggerImage  = Resources.Slider_Dragger_OnPress;
            this.sldProgress.RailEdgeInset      = new Padding(6, 5, 6, 5);
            this.sldProgress.RailImage          = Resources.Slider_Rail;
            this.sldProgress.RailPadding        = new Padding(0);
            this.sldProgress.RailWidth          = 10;
            this.sldProgress.Size          = new Size(375, 20);
            this.sldProgress.Value         = 0F;
            this.sldProgress.ValueChanged += new ValueChangedEventHandler(this.sldProgress_ValueChanged);
            this.sldProgress.Hover        += new HoverEventHandler(this.sldProgress_Hover);
            this.sldProgress.MouseLeave   += new EventHandler(this.sldProgress_MouseLeave);
            //
            // labProgress
            //
            this.labProgress.Anchor    = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
            this.labProgress.Location  = new Point(422, 8);
            this.labProgress.Size      = new Size(85, 16);
            this.labProgress.Text      = "0:00/0:00";
            this.labProgress.TextColor = Color.White;
            this.labProgress.Font      = new Font("Microsoft YaHei UI", 9);
            //
            // btnVolume
            //
            this.btnVolume.Anchor      = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
            this.btnVolume.HoverImage  = Resources.Volume_3;
            this.btnVolume.Location    = new Point(517, 6);
            this.btnVolume.NormalImage = Resources.Volume_3_OnPress;
            this.btnVolume.PressImage  = Resources.Volume_3_OnPress;
            this.btnVolume.Size        = new Size(20, 20);
            this.btnVolume.Click      += new System.EventHandler(this.btnVolume_Click);
            //
            // sldVolume
            //
            this.sldVolume.Anchor            = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
            this.sldVolume.DraggerEdgeInset  = new Padding(0);
            this.sldVolume.DraggerSize       = new Size(17, 15);
            this.sldVolume.HoverDraggerImage = Resources.Volume_Dragger;
            this.sldVolume.Location          = new Point(537, 10);
            this.sldVolume.Name = "sldVolume";
            this.sldVolume.NormalDraggerImage = Resources.Volume_Dragger_OnPress;
            this.sldVolume.PressDraggerImage  = Resources.Volume_Dragger_OnPress;
            this.sldVolume.RailEdgeInset      = new Padding(5, 4, 5, 4);
            this.sldVolume.RailImage          = Resources.Volume_Rail;
            this.sldVolume.RailWidth          = 9;
            this.sldVolume.Size          = new Size(70, 15);
            this.sldVolume.ValueChanged += this.SldVolume_ValueChanged;
            //
            // btnFullScreen
            //
            this.btnFullScreen.Anchor      = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
            this.btnFullScreen.HoverImage  = Resources.Full_Screen;
            this.btnFullScreen.Location    = new Point(615, 8);
            this.btnFullScreen.NormalImage = Resources.Full_Screen_OnPress;
            this.btnFullScreen.PressImage  = Resources.Full_Screen_OnPress;
            this.btnFullScreen.Size        = new Size(15, 17);
            this.btnFullScreen.Click      += new System.EventHandler(this.btnFullScreen_Click);



            this.zContainer1.ZControls.Add(this.btnPlay);
            this.zContainer1.ZControls.Add(this.btnPause);
            this.zContainer1.ZControls.Add(this.btnStop);
            this.zContainer1.ZControls.Add(this.sldProgress);
            this.zContainer1.ZControls.Add(this.labProgress);
            this.zContainer1.ZControls.Add(this.btnVolume);
            this.zContainer1.ZControls.Add(this.sldVolume);
            this.zContainer1.ZControls.Add(this.btnFullScreen);


            this.btnPlay.EndInit();
            this.btnPause.EndInit();
            this.btnStop.EndInit();
            this.sldProgress.EndInit();
            this.labProgress.EndInit();
            this.btnVolume.EndInit();
            this.sldVolume.EndInit();
            this.btnFullScreen.EndInit();
        }