Exemplo n.º 1
0
    protected override void OnCreate()
    {
        base.OnCreate();

        window = NUIApplication.GetDefaultWindow();

        slider = new CircularSlider();
        slider.CurrentValue = 0;

        // These properties have default values, so they're set to the following values
        // even if you don't set them separately.
        slider.MinValue  = 0;
        slider.MaxValue  = 10;
        slider.Thickness = 6;

        window.Add(slider);

        CreateLabelAndIcon();

        // Bezel event
        window.WheelEvent += Slider_WheelEvent;

        // If you want to change the colors of the track and the progress,
        // use TrackColor and ProgressColor properties.

        // If you want to change thumb color and size,
        // use ThumbColor and ThumbSize properties.
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.LightGray;


            var circularSlider = new CircularSlider(new CGRect(0, 100, View.Bounds.Width, View.Bounds.Width));

            circularSlider.SetHandleType(CircularSlider.CircularSliderHandleType.CircularSliderHandleTypeDoubleCircleWithOpenCenter);
            circularSlider.BackgroundColor = UIColor.FromWhiteAlpha(0, 0.1f);
            circularSlider.SetFilledColor(UIColor.FromRGBA(155 / 255f, 211 / 255f, 156 / 255f, 1.0f));

            var nsarray = new List <string> ()
            {
                new NSString("1"), new NSString("2"), new NSString("3"), new NSString("4"), new NSString("5"), new NSString("6")
            };

            circularSlider.SetInnerMarkingLabels(nsarray);
            View.AddSubview(circularSlider);
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Top, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Top, 1.0f, 0.0f));
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Left, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Left, 1.0f, 0.0f));
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Right, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Right, 1.0f, 0.0f));
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Bottom, 1.0f, 0.0f));
        }
 void Rotate3DCamera(CircularSlider circularSlider)
 {
     GameManager_script.Instance().CanControlCue = false;
     transform.Rotate(Vector3.up, -rotationSpeed * camera3dSlider.displacementZ * Time.deltaTime);
     rotation -= 0.5f * rotationSpeed * camera3dSlider.displacementX * Time.deltaTime;
     rotation  = Mathf.Clamp(rotation, minAngle, maxAngle);
     rotator.localRotation = Quaternion.Euler(rotation, 0.0f, 0.0f);
 }
Exemplo n.º 4
0
	void Rotate3DCamera (CircularSlider circularSlider)
	{
		MenuControllerGenerator.controller.canControlCue = false;
		transform.Rotate(Vector3.up, -rotationSpeed*camera3dSlider.displacementZ*Time.deltaTime);
		rotation -= 0.5f*rotationSpeed*camera3dSlider.displacementX*Time.deltaTime;
		rotation = Mathf.Clamp(rotation, minAngle, maxAngle);
		rotator.localRotation = Quaternion.Euler( rotation, 0.0f, 0.0f );
	}
Exemplo n.º 5
0
    void SlideBallPivot (CircularSlider circularSlider) {
        if(ServerController.serverController && !ServerController.serverController.isMyQueue)
            return;

        MenuControllerGenerator.controller.canControlCue = false;
        transform.localPosition = new Vector3 (-circularSlider.displacementZ, circularSlider.displacementX, 0.0f);
        float distance = Vector3.Distance (transform.position, strPosition);
        if(distance > radius) {
            transform.position -= (distance - radius) * (transform.position - strPosition).normalized;
        }
    }
        void ReleaseDesignerOutlets()
        {
            if (CircularSlider != null)
            {
                CircularSlider.Dispose();
                CircularSlider = null;
            }

            if (LevelIndicator != null)
            {
                LevelIndicator.Dispose();
                LevelIndicator = null;
            }
        }
Exemplo n.º 7
0
    void SlideBallPivot(CircularSlider circularSlider)
    {
        if (cueController.NetworkSlaveInControl())
        {
            return;
        }

        GameManager_script.Instance().CanControlCue = false;

        transform.localPosition = new Vector3(-circularSlider.displacementZ, circularSlider.displacementX, 0.0f);
        float distance = Vector3.Distance(transform.position, strPosition);

        if (distance > radius)
        {
            transform.position -= (distance - radius) * (transform.position - strPosition).normalized;
        }
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.LightGray;

            var circularSlider = new CircularSlider(new CGRect(0, 100, View.Bounds.Width, View.Bounds.Width));
            circularSlider.SetHandleType (CircularSlider.CircularSliderHandleType.CircularSliderHandleTypeDoubleCircleWithOpenCenter);
            circularSlider.BackgroundColor = UIColor.FromWhiteAlpha (0, 0.1f);
                circularSlider.SetFilledColor (UIColor.FromRGBA (155/255f, 211/255f, 156/255f, 1.0f));

            var nsarray = new List<string> (){ new NSString ("1"), new NSString ("2"),new NSString("3"),new NSString("4"),new NSString("5"), new NSString("6") };

            circularSlider.SetInnerMarkingLabels (nsarray);
            View.AddSubview(circularSlider);
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Top, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Top, 1.0f, 0.0f));
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Left, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Left, 1.0f, 0.0f));
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Right, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Right, 1.0f, 0.0f));
            //View.AddConstraint(NSLayoutConstraint.Create(View, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, circularSlider, NSLayoutAttribute.Bottom, 1.0f, 0.0f));
        }
Exemplo n.º 9
0
    public override void OnCreate(View root)
    {
        root.BackgroundColor = Color.Black;

        slider = new CircularSlider()
        {
            PositionUsesPivotPoint = true,
            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
        };
        slider.CurrentValue = 0;

        // These properties have default values, so they're set to the following values
        // even if you don't set them separately.
        slider.MinValue  = 0;
        slider.MaxValue  = 10;
        slider.Thickness = 6;

        root.Add(slider);

        CreateLabelAndIcon(root);
    }
Exemplo n.º 10
0
    public void changeRotateCue (CircularSlider circularSlider) {
        MenuControllerGenerator.controller.canControlCue = false;
        //transform.Rotate (Vector3.up, -rotationSpeed * camera3dSlider.displacementZ * Time.deltaTime);
        rotation -= circularSlider.displacementX * Time.deltaTime;
        //rotation = Mathf.Clamp (rotation, minAngle, maxAngle);
        //rotator.localRotation = Quaternion.Euler (rotation, 0.0f, 0.0f);

        //float orientY = menu.GetScreenPoint ().y - cuePivotScreenPoint.y > 0.0f ? 1.0f : -1.0f;
        //float orientX = menu.GetScreenPoint ().x - cuePivotScreenPoint.x > 0.0f ? 1.0f : -1.0f;
        //float speed = orientY * menu.MouseScreenSpeed.x - orientX * menu.MouseScreenSpeed.y;

        //touchRotateAngle = Mathf.Lerp (touchRotateAngle,
        //                              touchSensitivity * speed * Mathf.Abs (speed) * Time.deltaTime, 10.0f * Time.deltaTime);

        //cuePivot.Rotate (Vector3.up, touchRotateAngle);

       float rotateAngle = Mathf.Lerp (rotation, 10, 45);
        //-5 * circularSlider.displacementX * Time.deltaTime
       cuePivot.Rotate (Vector3.up, rotateAngle);
    }
Exemplo n.º 11
0
 public void Setup(GameVariable thisGameVar)
 {
     gameVar        = thisGameVar;
     slider         = GetComponentInChildren <CircularSlider>();
     titleText.text = gameVar.name;
 }
Exemplo n.º 12
0
	public void Setup (GameVariable thisGameVar) {
        gameVar = thisGameVar;
        slider = GetComponentInChildren<CircularSlider>();
        titleText.text = gameVar.name;
	}