예제 #1
0
    private void OnChooseColor(object sender, EventArgs args)
    {
        Drawing.Color col = new Drawing.Color();
        col.Red   = ((float)colorButton.Color.Red) / 65535f;
        col.Blue  = ((float)colorButton.Color.Blue) / 65535f;
        col.Green = ((float)colorButton.Color.Green) / 65535f;
        col.Alpha = 1f;
        if (useAlpha)
        {
            col.Alpha = ((float)colorButton.Alpha) / 65535f;
        }

        if (col != (Drawing.Color)Field.GetValue(Object))
        {
            PropertyChangeCommand command = new PropertyChangeCommand(
                "Changed value of " + Field.Name,
                Field,
                Object,
                col);
            command.Do();
            UndoManager.AddCommand(command);
            //Console.WriteLine("ChooseColorWidget change col r{0},g{1},b{2},a{3}", col.Red, col.Green, col.Blue, col.Alpha);
            //Console.WriteLine("ChooseColorWidget change gtk color r{0},g{1},b{2},a{3}", colorButton.Color.Red, colorButton.Color.Green, colorButton.Color.Blue, colorButton.Alpha);
        }
    }
예제 #2
0
    protected override void OnFieldChanged(FieldOrProperty field)
    {
        Drawing.Color val = (Drawing.Color)Field.GetValue(Object);

        Gdk.Color color = new Gdk.Color();
        color.Red   = (ushort)(val.Red * 65535f);
        color.Green = (ushort)(val.Green * 65535f);
        color.Blue  = (ushort)(val.Blue * 65535f);

        if (useAlpha)
        {
            colorButton.Alpha = (ushort)(val.Alpha * 65535f);
        }

        colorButton.Color = color;
    }
예제 #3
0
    public virtual void DrawColor(Drawing.Color color)
    {
        //draw a color rectangle
        float left   = X + 8;
        float right  = X + 24;
        float top    = Y + 8;
        float bottom = Y + 24;

        float[] current_color = new float[4];
        gl.GetFloatv(gl.CURRENT_COLOR, current_color);
        //get current color, might be transparent
        gl.Color4f(color.Red, color.Green, color.Blue, color.Alpha * current_color[3]);
        gl.Disable(gl.TEXTURE_2D);

        gl.Begin(gl.QUADS);
        gl.Vertex2f(left, top);
        gl.Vertex2f(right, top);
        gl.Vertex2f(right, bottom);
        gl.Vertex2f(left, bottom);
        gl.End();

        gl.Enable(gl.TEXTURE_2D);
        gl.Color4fv(current_color);
    }
    private void OnChooseColor(object sender, EventArgs args)
    {
        Drawing.Color col = new Drawing.Color();
        col.Red = ((float) colorButton.Color.Red) / 65535f;
        col.Blue = ((float) colorButton.Color.Blue) / 65535f;
        col.Green = ((float) colorButton.Color.Green) / 65535f;
        col.Alpha = 1f;
        if (useAlpha)
            col.Alpha = ((float) colorButton.Alpha) / 65535f;

        if (col != (Drawing.Color) Field.GetValue(Object)) {
            PropertyChangeCommand command = new PropertyChangeCommand(
                "Changed value of " + Field.Name,
                Field,
                Object,
                col);
            command.Do();
            UndoManager.AddCommand(command);
            //Console.WriteLine("ChooseColorWidget change col r{0},g{1},b{2},a{3}", col.Red, col.Green, col.Blue, col.Alpha);
            //Console.WriteLine("ChooseColorWidget change gtk color r{0},g{1},b{2},a{3}", colorButton.Color.Red, colorButton.Color.Green, colorButton.Color.Blue, colorButton.Alpha);
        }
    }
 private void OnChooseColor(object sender, EventArgs args)
 {
     Drawing.Color col = new Drawing.Color();
     col.Red = ((float) colorButton.Color.Red) / 65535f;
     col.Blue = ((float) colorButton.Color.Blue) / 65535f;
     col.Green = ((float) colorButton.Color.Green) / 65535f;
     col.Alpha = 1f;
     if (useAlpha)
         col.Alpha = ((float) colorButton.Alpha) / 65535f;
     field.SetValue(Object, col);
     //Console.WriteLine("ChooseColorWidget change col r{0},g{1},b{2},a{3}", col.Red, col.Green, col.Blue, col.Alpha);
     //Console.WriteLine("ChooseColorWidget change gtk color r{0},g{1},b{2},a{3}", colorButton.Color.Red, colorButton.Color.Green, colorButton.Color.Blue, colorButton.Alpha);
 }
예제 #6
0
 public AmbientLightObject()
 {
     Color = new Drawing.Color(1f, 1f, 1f);
 }
예제 #7
0
 public AmbientLightObject(Drawing.Color color)
 {
     Color = color;
 }
예제 #8
0
 public SecretArea()
 {
     Color = new Drawing.Color(0, .8f, 0, 0.8f);
 }
예제 #9
0
 public Climbable()
 {
     Color = new Drawing.Color(.8f, .8f, 0, 0.8f);
 }
예제 #10
0
 public InvisibleWall()
 {
     Color = new Drawing.Color(0, 0, 0, 0.8f);
 }
예제 #11
0
 public ScriptTrigger()
 {
     Color = new Drawing.Color(.8f, 0, .8f, 0.8f);
 }
예제 #12
0
 public SequenceTrigger()
 {
     Color = new Drawing.Color(.8f, 0, 0, 0.8f);
 }
예제 #13
0
 public AmbientSound()
 {
     Sprite        = SpriteManager.CreateFromImage("images/engine/editor/ambientsound.png");
     Sprite.Action = "default";
     Color         = new Drawing.Color(0, 0, 0.8f, 0.8f);
 }
예제 #14
0
 public Wind()
 {
     Color = new Drawing.Color(0, 0.8f, 0.8f, 0.8f);
 }