Exemplo n.º 1
0
        public RandomNumberEditor AddRandomNumberEditor(Control field)
        {
            RandomNumberEditor editor = randomNumberScene.Instance() as RandomNumberEditor;

            AddEditor(field, editor);
            return(editor);
        }
Exemplo n.º 2
0
        public override void DrawInterface(Control parent)
        {
            Control lifetimeField   = moduleInterface.AddField("Lifetime");
            Control speedField      = moduleInterface.AddField("Speed");
            Control sizeField       = moduleInterface.AddField("Size");
            Control rotationField   = moduleInterface.AddField("Rotation");
            Control startColorField = moduleInterface.AddField("Color");

            RandomNumberEditor randomLifetimeEditor = moduleInterface.AddRandomNumberEditor(lifetimeField);
            RandomNumberEditor randomSpeedEditor    = moduleInterface.AddRandomNumberEditor(speedField);
            RandomNumberEditor randomSizeEditor     = moduleInterface.AddRandomNumberEditor(sizeField);
            RandomNumberEditor randomRotationEditor = moduleInterface.AddRandomNumberEditor(rotationField);
            ColorPickerButton  startColorEditor     = moduleInterface.AddColorEditor(startColorField);

            randomLifetimeEditor.minValue     = minLifetime;
            randomLifetimeEditor.maxValue     = maxLifetime;
            randomLifetimeEditor.mode         = lifetimeMode;
            randomLifetimeEditor.allowGreater = true;
            randomLifetimeEditor.allowLesser  = true;
            randomLifetimeEditor.Connect("Changed", this, "OnRandomLifetimeChanged");

            randomSpeedEditor.minValue     = minSpeed;
            randomSpeedEditor.maxValue     = maxSpeed;
            randomSpeedEditor.mode         = speedMode;
            randomSpeedEditor.allowGreater = true;
            randomSpeedEditor.allowLesser  = true;
            randomSpeedEditor.Connect("Changed", this, "OnRandomSpeedChanged");

            randomSizeEditor.minValue      = minSize;
            randomSizeEditor.maxValue      = maxSize;
            randomSizeEditor.mode          = sizeMode;
            randomSpeedEditor.allowGreater = true;
            randomSpeedEditor.allowLesser  = true;
            randomSizeEditor.Connect("Changed", this, "OnRandomSizeChanged");

            randomRotationEditor.minValue  = minRotation;
            randomRotationEditor.maxValue  = maxRotation;
            randomRotationEditor.mode      = rotationMode;
            randomSpeedEditor.allowGreater = true;
            randomSpeedEditor.allowLesser  = true;
            randomRotationEditor.Connect("Changed", this, "OnRandomRotationChanged");

            startColorEditor.Color = startColor;
            startColorEditor.Connect("color_changed", this, "OnStartColorChanged");
        }