v1p_kokorinParticipantAugust 21, 2012 at 8:28 pm #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?AnonymousInactiveAugust 22, 2012 at 4:13 am #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 = brushAlphaFionnualaParticipantNovember 6, 2014 at 10:24 am #83079
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 https://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, FionnualaYamamotoKeymasterNovember 9, 2014 at 7:28 pm #83108
Please wait a while I check the behavior of brush with Alex’s tutorial this weekYamamotoKeymasterNovember 11, 2014 at 1:10 am #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.
You must be logged in to reply to this topic.