コード例 #1
0
ファイル: MatrixEditors.cs プロジェクト: louis030195/niwrad
        private static void DrawBlendLayer(Generator tgen, int num)
        {
            Blend200 gen = (Blend200)tgen;

            Blend200.Layer layer = gen.layers[num];

            Cell.EmptyLinePx(2);

            using (Cell.LineStd)
            {
                using (Cell.RowPx(0))
                    GeneratorDraw.DrawInlet(layer.inlet, gen);
                Cell.EmptyRowPx(10);

                using (Cell.RowPx(20)) Draw.Icon(UI.current.textures.GetTexture("DPUI/Icons/Layer"));

                if (num == 0)
                {
                    layer.algorithm = MatrixGenerators.Blend200.BlendAlgorithm.add;
                    using (Cell.Row) Draw.Label("Background");
                }

                else
                {
                    if (!layer.guiExpanded)
                    {
                        using (Cell.Row) {
                            layer.algorithm = Draw.Field(layer.algorithm);
                        }
                        //Draw.AddFieldToCellObj(typeof(MatrixGenerators.Blend200.Layer), "algorithm"); }
                        //could not be exposed since it's layer value, not generator one
                        using (Cell.RowPx(20)) layer.guiExpanded = Draw.LayerChevron(layer.guiExpanded);
                    }

                    else
                    {
                        using (Cell.Row)
                        {
                            using (Cell.LineStd) {
                                layer.algorithm = Draw.Field(layer.algorithm);
                            }
                            //Draw.AddFieldToCellObj(typeof(MatrixGenerators.Blend200.Layer), "algorithm"); }
                            using (Cell.LineStd) {
                                Draw.FieldDragIcon(ref layer.opacity, UI.current.textures.GetTexture("DPUI/Icons/Opacity"));
                            }
                            //Draw.AddFieldToCellObj(typeof(MatrixGenerators.Blend200.Layer), "opacity"); }
                        }

                        using (Cell.RowPx(20))
                            using (Cell.LineStd) layer.guiExpanded = Draw.LayerChevron(layer.guiExpanded);
                    }

                    /*using (Cell.RowPx(35))
                     * {
                     *      //Draw.Field(ref layer.opacity);
                     *      Draw.FieldDragIcon(ref layer.opacity, UI.current.textures.GetTexture("DPUI/Icons/Opacity"));
                     * }*/
                }

                Cell.EmptyRowPx(3);
            }


            Cell.EmptyLinePx(2);
        }
コード例 #2
0
ファイル: MatrixEditors.cs プロジェクト: louis030195/niwrad
 public static void BlendGeneratorEditor(Blend200 gen)
 {
     using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
     using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawBlendLayer);
 }