Skip to content

Brush Color Change #9

@unknownuser23

Description

@unknownuser23

Great job on updating to Touch. I know the 1st grafitti library pretty good and am working on expanding on this one and builing a UI. My issue is I can not get color changed on brushes without recalling the main funtion canvas.brush = round_brush; and when I do that it will change the color but erases the screen and create new tool color. So i called canvas.drawtocanvas(canvas); prior to changeing. I have somewhat the same with size of tool. I can make all but RoundBrush to change live but RoundBrush only changes after recalling canvas.brush = round_brush; Here is a example of color change, and slider funtion I am using. Am I doing something wrong here? Show I be useing .transformColor ?
Thanks

/**************************************************************************
Method : colorPickerHandler()
***************************************************************************/

    function colorPickerHandler(e:ColorPickerEvent):void {

    if(canvas.brush == square_brush) {

         canvas.drawToCanvas(canvas);

        _pickedColor = tool_bar.fill_color_mc.selectedColor;
        square_brush.color = _pickedColor;
        //SquareBrush(canvas.brush).color = _pickedColor;
        canvas.brush = square_brush;

         trace("color changed:",  "0x" + e.target.hexValue);
         trace("good");


        } else {

            trace("bad");


        }
    }

/**************************************************************************
Method : sliderHandler()
***************************************************************************/
function sliderHandler(e:SliderEvent):void {

                _brushSize = e.value;
                //round_brush(canvas.brush).size = _brushSize;
                square_brush.size = _brushSize;
         trace ("slider slid");

            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions