Esempio n. 1
0
        public void Init(Form1 mainForm, CoronaJointure joint)
        {
            this.MainForm = mainForm;
            this.cJoint   = joint;
            modePanel     = "NEW";

            if (this.cJoint.type.Equals("WHEEL"))
            {
                this.objA   = cJoint.coronaObjA;
                obj1Tb.Text = objA.DisplayObject.Name;
                this.objB   = cJoint.coronaObjB;
                obj2Tb.Text = objB.DisplayObject.Name;

                this.axisDistance   = cJoint.axisDistance;
                axisDistanceTb.Text = axisDistance.ToString();

                this.setAnchorPoint(cJoint.AnchorPointA);



                motorSpeedNup.Value = Convert.ToInt32(cJoint.motorSpeed);

                motorForceNup.Value = Convert.ToInt32(cJoint.maxMotorTorque);

                modePanel = "MODIFY";
            }
        }
Esempio n. 2
0
        //---------------------------------------------------
        //-------------------Methodes------------------------
        //---------------------------------------------------
        public void init(Form1 mainForm, CoronaJointure joint)
        {
            this.joint     = joint;
            this.mainForm  = mainForm;
            this.modePanel = "NEW";

            if (this.joint.type.Equals("PISTON"))
            {
                this.isMotorEnabledChkBx.Checked = joint.isMotorEnable;
                this.isLimitedChkBx.Checked      = joint.isLimitEnabled;

                this.motorSpeedNumUpDw.Value    = System.Convert.ToInt32(joint.motorSpeed);
                this.maxMotorForceNumUpDw.Value = System.Convert.ToInt32(joint.maxMotorForce);

                this.nameObj1TxtBx.Text = joint.coronaObjA.DisplayObject.Name;
                this.nameObj2TxtBx.Text = joint.coronaObjB.DisplayObject.Name;

                this.axisDistanceTxtBx.Text = joint.axisDistance.ToString();

                this.objA = joint.coronaObjA;
                this.objB = joint.coronaObjB;

                this.anchorPoint  = joint.AnchorPointA;
                this.axisDistance = joint.axisDistance;
                this.modePanel    = "MODIFY";
            }
        }
Esempio n. 3
0
        //---------------------------------------------------
        //-------------------Methodes------------------------
        //---------------------------------------------------
        public void init(Form1 mainForm, CoronaJointure joint)
        {
            this.joint    = joint;
            this.mainForm = mainForm;


            if (this.joint.type.Equals("DISTANCE"))
            {
                this.frequencyNumUpDw.Value    = System.Convert.ToInt32(joint.frequency);
                this.dampingRatioNumUpDw.Value = System.Convert.ToInt32(joint.dampingRatio);

                this.nameObj1TxtBx.Text = joint.coronaObjA.DisplayObject.Name;
                this.nameObj2TxtBx.Text = joint.coronaObjB.DisplayObject.Name;

                this.objA = joint.coronaObjA;
                this.objB = joint.coronaObjB;

                this.modePanel = "MODIFY";
            }
            else
            {
                this.modePanel = "NEW";
                this.frequencyNumUpDw.Value    = 0;
                this.dampingRatioNumUpDw.Value = 0;

                this.nameObj1TxtBx.Text = "";
                this.nameObj2TxtBx.Text = "";
            }
        }
Esempio n. 4
0
 public void Init(Form1 mainForm, CoronaJointure joint)
 {
     this.MainForm  = mainForm;
     this.cJoint    = joint;
     this.modePanel = "NEW";
     if (this.cJoint.type.Equals("TOUCH"))
     {
         this.objTb.Text         = cJoint.coronaObjA.DisplayObject.Name;
         this.obj                = cJoint.coronaObjA;
         this.anchorPointTb.Text = cJoint.AnchorPointA.ToString();
         this.anchorPoint        = cJoint.AnchorPointA;
         this.modePanel          = "MODIFY";
     }
 }
Esempio n. 5
0
        public void Init(Form1 mainForm, CoronaJointure joint)
        {
            this.MainForm  = mainForm;
            this.cJoint    = joint;
            this.modePanel = "NEW";
            if (this.cJoint.type.Equals("FRICTION"))
            {
                this.obj1Tb.Text = cJoint.coronaObjA.DisplayObject.Name;
                objA             = cJoint.coronaObjA;
                this.obj2Tb.Text = cJoint.coronaObjB.DisplayObject.Name;
                objB             = cJoint.coronaObjB;
                anchorPoint      = cJoint.AnchorPointA;

                this.maxForceNup.Value  = Convert.ToInt32(cJoint.maxForce);
                this.maxTorqueNup.Value = Convert.ToInt32(cJoint.maxTorque);
                this.modePanel          = "MODIFY";
            }
        }
Esempio n. 6
0
        public void Init(Form1 mainForm, CoronaJointure joint)
        {
            this.MainForm  = mainForm;
            this.cJoint    = joint;
            this.modePanel = "NEW";
            if (this.cJoint.type.Equals("PULLEY"))
            {
                setObjectA(cJoint.coronaObjA);
                setObjectB(cJoint.coronaObjB);

                setAnchorPointA(cJoint.AnchorPointA);
                setAnchorPointB(cJoint.AnchorPointB);

                setObjAnchorPointA(cJoint.ObjectAnchorPointA);
                setObjAnchorPointB(cJoint.ObjectAnchorPointB);

                this.modePanel = "MODIFY";
            }
        }
Esempio n. 7
0
        //---------------------------------------------------
        //-------------------Methodes------------------------
        //---------------------------------------------------
        public void init(Form1 mainForm, CoronaJointure joint)
        {
            this.joint    = joint;
            this.mainForm = mainForm;
            CreationStep  = 0;

            if (this.joint.type.Equals("PIVOT"))
            {
                this.isMotorEnabledChkBx.Checked = joint.isMotorEnable;
                this.isLimitedChkBx.Checked      = joint.isLimitEnabled;

                this.motorSpeedNumUpDw.Value = System.Convert.ToInt32(joint.motorSpeed);
                this.maxTorqueNumUpDw.Value  = System.Convert.ToInt32(joint.maxMotorTorque);

                this.nameObj1TxtBx.Text = joint.coronaObjA.DisplayObject.Name;
                this.nameObj2TxtBx.Text = joint.coronaObjB.DisplayObject.Name;

                this.upperLimitNumUpDw.Value = Convert.ToDecimal(joint.upperLimit);
                this.lowerLimitNumUpDw.Value = Convert.ToDecimal(joint.lowerLimit);

                this.objA        = joint.coronaObjA;
                this.objB        = joint.coronaObjB;
                this.anchorPoint = joint.AnchorPointA;
                modePanel        = "MODIFY";
            }
            else
            {
                this.isMotorEnabledChkBx.Checked = false;
                this.isLimitedChkBx.Checked      = false;

                this.motorSpeedNumUpDw.Value = 0;
                this.maxTorqueNumUpDw.Value  = 0;

                this.upperLimitNumUpDw.Value = 0;
                this.lowerLimitNumUpDw.Value = 0;
                this.nameObj1TxtBx.Text      = "";
                this.nameObj2TxtBx.Text      = "";
                modePanel = "NEW";
            }
        }
Esempio n. 8
0
 public PulleyPropertyConverter(CoronaJointure joint, Form1 MainForm)
 {
     this.jointSelected = joint;
     this.MainForm      = MainForm;
 }
        public void refreshAPI(string sourcePage)
        {
            //Clear all lists
            this.Categories.Clear();
            this.Items.Clear();


            //Chercher toutes les infex de href="#
            int    indexStart           = 0;
            int    indexFirstEndBalise  = 0;
            int    indexSecondEndBalise = 0;
            string strStart             = "href=\"#";
            string strEndFirstBalise    = ">";
            string strEndSecondBalise   = "</a>";

            while (indexStart < sourcePage.Length)
            {
                indexStart = sourcePage.IndexOf(strStart, indexSecondEndBalise);
                if (indexStart == -1)
                {
                    break;
                }

                indexFirstEndBalise = sourcePage.IndexOf(strEndFirstBalise, indexStart);
                if (indexFirstEndBalise == -1)
                {
                    break;
                }

                indexSecondEndBalise = sourcePage.IndexOf(strEndSecondBalise, indexFirstEndBalise);
                if (indexSecondEndBalise == -1)
                {
                    break;
                }

                string content = sourcePage.Substring(indexFirstEndBalise + 1, indexSecondEndBalise - indexFirstEndBalise - 1);

                //Treat the content
                content = content.Replace("\n", "");
                content = content.Replace(" ", "");

                //Treat if is a category
                if (content.Contains("."))
                {
                    string catName  = content.Substring(0, content.IndexOf("."));
                    int    len      = content.Length - content.IndexOf(".");
                    string itemName = content.Substring(content.IndexOf(".") + 1, len - 1);
                    this.addItem(catName, itemName, false);
                }
                else if (content.Contains(":"))
                {
                    string catName  = content.Substring(0, content.IndexOf(":"));
                    int    len      = content.Length - content.IndexOf(":");
                    string itemName = content.Substring(content.IndexOf(":") + 1, len - 1);
                    this.addItem(catName, itemName, true);
                }
                else
                {
                    this.addItem(null, content, false);
                }
            }

            APICategory objectCategory = null;

            for (int i = 0; i < this.Categories.Count; i++)
            {
                if (this.Categories[i].name.ToLower().Equals("object"))
                {
                    objectCategory = this.Categories[i];
                    break;
                }
            }

            if (this.editorParent.sceneSelected != null)
            {
                CoronaGameProject currentProject = this.editorParent.sceneSelected.projectParent;
                if (currentProject != null)
                {
                    APICategory catStoryboard = new APICategory("storyboard");
                    this.Categories.Add(catStoryboard);

                    if (currentProject.Snippets.Count > 0)
                    {
                        APICategory catSnippets = new APICategory("snippets");
                        this.Categories.Add(catSnippets);
                        for (int i = 0; i < currentProject.Snippets.Count; i++)
                        {
                            Snippet snippet     = currentProject.Snippets[i];
                            APIItem itemSnippet = new APIItem(snippet.Name.Replace(" ", ""), true);
                            catSnippets.Items.Add(itemSnippet);
                        }
                    }


                    APICategory catResources = new APICategory("resources");
                    catStoryboard.SubCategories.Add(catResources);

                    //AJouter les scenes
                    for (int i = 0; i < currentProject.Scenes.Count; i++)
                    {
                        Scene       scene    = currentProject.Scenes[i];
                        APICategory catScene = new APICategory(scene.Name);
                        catResources.SubCategories.Add(catScene);

                        for (int j = 0; j < scene.Layers.Count; j++)
                        {
                            CoronaLayer layer    = scene.Layers[j];
                            APICategory catLayer = new APICategory(layer.Name);
                            catScene.SubCategories.Add(catLayer);

                            for (int k = 0; k < layer.CoronaObjects.Count; k++)
                            {
                                CoronaObject obj    = layer.CoronaObjects[k];
                                APICategory  catObj = new APICategory(obj.DisplayObject.Name);
                                catLayer.SubCategories.Add(catObj);

                                if (objectCategory != null)
                                {
                                    catObj.SubCategories.Add(objectCategory);
                                }
                            }

                            for (int k = 0; k < layer.Jointures.Count; k++)
                            {
                                CoronaJointure joint     = layer.Jointures[k];
                                APIItem        itemJoint = new APIItem(joint.name, false);
                                catLayer.Items.Add(itemJoint);
                            }

                            for (int k = 0; k < layer.Controls.Count; k++)
                            {
                                CoronaControl control     = layer.Controls[k];
                                APIItem       itemControl = new APIItem(control.ControlName, false);
                                catLayer.Items.Add(itemControl);
                            }
                        }
                    }
                }
            }
        }