Home / Topic / Brush texture

Brush texture

Viewing 6 posts - 1 through 6 (of 6 total)
  • v1p_kokorin
    Participant
    #9426

    Hello Alex;Is there a remote chance to be able to create custom brush shapes? Like to be able to simulate a chalk or paint?

    Anonymous
    #12654

    There are two answers here. Yes, it would be possible to simulate a brush (using an image as reference), as we do currently with a vector circle. However, unfortunately not until Corona provides a way to play with bitmap manipulation this is not something I am planning to implement. This is because I would have to re-write lots of lines of code to handle the different options (use the current circle or use a “brush”) plus the fact (that's where the bitmap manipulation enters) that an image brush couldn't be colored (meaning if you image layer containing the shape of the brush is red, you would only use the brush in red).If you want to do it manually, create your canvas project "as is" then, replace the following line:

    Code:
    local painter =  display.newCircle( event.x, event.y, brushSize, 100 ) painter:setFillColor(cR, cG, cB); painter.alpha = brushAlpha

    by (assuming your image layer name was exported as p1_butblack.png and its dimension is 122x123px):

    Code:
    local painter =  display.newImageRect( imgDir.. "p1_butblack.png", 122, 123 );painter.x = event.x; painter.y = event.y--painter:setFillColor(cR, cG, cB); painter.alpha = brushAlpha 

    Fionnuala
    Participant
    #83079

    Hi Naoya

    I am having an issue with the canvas brush feature in Kwik, using version 3.2.4d. When setting the brush size I would like to set the alpha to semi-transparent as per Alex’s tutuorial http://kwiksher.com/tutorials_kwik/canvas/ However, when I do this, e.g. set the alpha to 50% it makes no difference in the simulator, ie. the alpha still shows as a 100% or in other words fully opaque. Any ideas as to what could be going wrong? Many thanks for your help, Fionnuala

    Yamamoto
    Keymaster
    #83108

    Please wait a while I check the behavior of brush with Alex’s tutorial this week

    Yamamoto
    Keymaster
    #83131

    I checked kwik’s internal behavior and seems it is a bug.
    You can see setStrokeColor, setFillColor in a generated lua file does not come with brushAlpha parameter.

    I will fix the problem and update kwik this week.

    Fionnuala
    Participant
    #83303

    Thank you Yamamoto for solving this problem. It works perfectly now.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.