Giter Club home page Giter Club logo

linedrawing's Introduction

Hi there πŸ‘‹

I am Principal engineer and creator of apps and tools that are trusted by over 80,000 teamsβ€”including industry leaders Apple, Disney, and Airbnb.

I've just released a video course that you can join if you want to save lots of time creating apps for Apple platforms.

πŸš€ I'm available for consulting and speaking engagements. Feel free to reach out to me to discuss opportunities.

In the past, I led iOS development at The New York Times, worked on apps such as Headspace, The Browser Company, and created my own indie apps like Foldify.

Community Work

You can sponsor my work and get premium content on my blog.

My Expertise

I focus on creating maintainable architecture and improving developer experience and efficiency by:

  • πŸ€” Designing flexible architecture that is easy to maintain
  • βš™οΈ Creating automation for common code tasks and workflows
  • πŸ‘₯ Establishing best practices for architecture, testing, and workflows
  • πŸ“‹ As a consultant, I usually:
    • πŸ€” Perform code reviews for entire projects and provide clients with practical recommendations to improve their team efficiency and satisfaction (through better development experience and automation)
    • πŸ‘₯ Help establish best practices and provide architecture recommendations
    • πŸ› οΈ Design and implement flexible and pragmatic solutions for hard problems
  • πŸ§™ And much more...

Talking with Me

  • 🐦 My Twitter: @merowing_
  • πŸ’¬ Pronouns: He/Him

You can learn more about me and my past experience on my blog.

linedrawing's People

Contributors

joostvanderborg avatar kaolin avatar kladdkaka avatar krzysztofzablocki avatar mbustamanteo avatar ramshandilya avatar richardgroves avatar virl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linedrawing's Issues

[renderTexture getUIImage] removes overdraw.

This is excellent drawing code! Thank you very much for supplying it.

One issue that I've noticed is, when you use [renderTexture getUIImage], the UIImage that is returned seems to ignore most of the overdraw. While drawing, the renderTexture looks nice and soft/smooth. However, when I go to save the drawing as a UIImage, most of the softness disappears.

As a rough example, you can recreate this issue by adding the following code to the init method of LineDrawer, then tapping the menu item to display the UIImage created from the renderTexture.

CCMenuItemFont *item = [CCMenuItemFont itemWithString:@"Show UIImage of renderTexture" block:^(id sender) {
          [[[CCDirector sharedDirector] view] addSubview:[[UIImageView alloc] initWithImage:[renderTexture getUIImage]]];
}];
CCMenu *menu = [CCMenu menuWithItems:item, nil];
[menu alignItemsHorizontally];
menu.position = ccp(item.contentSize.width / 2, [[CCDirector sharedDirector] winSize].height / 2);
menu.color = ccc3(255, 0, 0);
[self addChild:menu z:100];

Drawing and erasing over background image

Hi
I want to draw on an image which I put as background
however let me explained what happened when I followed your suggestions

1.If I put render the background image into renderTexture either only my background picture seemed and my drawings did not or my drawings seemed but not my background picture .I've tried to change their z-order and somehow it worked but then I figured out that when I erase the lines that I draw it erases the background image too
2.I've added the background image like this

        backgroundImage = [CCSprite spriteWithCGImage:bgNativeImage.CGImage key:@"backgroundImage"];
        [self calculateBgImageSize];
        backgroundImage.opacity = 150;
        [self addChild:backgroundImage z:1];

only this time I could be able to draw and erase lines on top of background image but this time my image seems transparent and it iritates the user
Can you suggest me a spesific way to handle this ? I thought on this a lot and it seems to me that only way to draw and erase the lines on top of an image is using layers such as photoshop

Then :
I've made something like this according to kryzstofz suggestion

if (self.bgNativeImage) {
    if (!backgroundImage) {
        backgroundImage = [CCSprite spriteWithCGImage:bgNativeImage.CGImage key:@"backgroundImage"];
        [self calculateBgImageSize];
        [backgroundImage setBlendFunc:(ccBlendFunc){GL_ONE, GL_ZERO}];
        [backgroundLayer addChild:backgroundImage];
        //backgroundImage.opacity = 150;
        //[self addChild:backgroundImage z:1];
    }
    //[backgroundImage visit];


} 

[renderTexture begin];

NSMutableArray *smoothedPoints = [self calculateSmoothLinePoints];
if (smoothedPoints) {
[self drawLines:smoothedPoints withColor:color];
}

if (self.bgNativeImage) {
[backgroundLayer setZOrder:1];
[backgroundLayer visit];
}
[renderTexture end];

now I can draw on image without any problem however when I try to erase the lines that I already draw.(with below algorithm) it also erases the background image

ccColor4F color = {0, 0, 0, 1};
if (!isPencilActive) {
ccColor4F eraserColor = {1,1,1,1};
color = eraserColor;
} else {
color = drawingColor;
}
Do you have any idea about it?
Thanks
Tolga

How can i add eraser ?

Hi. I have background image and i draw it . but i need add eraser that will erase just lines.(not the image). So how can i do that?

Drawing

how to switch one blendmode to another i.e in coregraphics we have so many blendmodes like normal blendmode,clear,copy etc. so i want to use clear blendmode for erasing the line on texture

Can i make your drawing with OpenGL ES?

Hello.

Thanks very much for your smooth-drawing project.
It give me actually helping.

Now i have one question.
Why did you make the engine with Cocos2d?
What is really the reason?

Id like to use with OpenGL ES, not cocos2d.
is it possible? if possible, what is the reference?
Let me know your thought.

Thanks,
Jin.

merowing?

Hello,

I wanted to read the blog post about the creation of this, but the link doesn't work. In fact http://www.merowing.info/ is down ?

I have not looked through the code, but my question is -- how necessary is Cocos 2D, and I was wondering how the antialiasing is done. Is it texture mapped?

Thanks
Bob

Message sent to deallocated instance?

I'm experiencing a similar issue to the one described in
krzysztofzablocki/CCNode-SFGestureRecognizers#2

Whenever I add an AdMob banner and it receives a callback I get *** -[_UIWebViewScrollView release]: message sent to deallocated instance 0x21cb01b0

But it seems to somehow originate from your library and/or Cocos2d as I was previously getting the same error for other ScrollViews but it never appears if I don't add the Drawing layer (taking out [scene addChild:lineDrawer]); gets rid of the problem. Also, the problem only occurs after switching ViewControllers.

Do you have any suggestions as for what might cause this?

Coordinates displaced

Using provided example I changed size like that:

lineDrawer.contentSize = CGSizeMake([CCDirector sharedDirector].viewSize.width*0.5,[CCDirector sharedDirector].viewSize.height*0.5);

As result, drawing coordinates do not match and are displaced.

cannot be able to draw dots

Hello
You have fantastic drawing alghoritm however there is a one little problem which is , it is impossible to draw small points such as dots commas etc..
It would be nice to have them

Thanks

can't build

Hello, great project, thanks.

I'm having trouble building the project, I'm getting CGPointExtension.h file not found. Made some research on this error but nothing worked for me.

Thanks

Missing first and last point from calculateSmoothLinePoints

I was using your code to draw bezier lines and I notice an issue. The calculateSmoothLinePoints method is not using the very first point or the very last, it only uses the midpoint. This makes sense when continually drawing, but when drawing (for example) only three points over a long span, it misses a large part of the line.

change line color

after changing line color drawing next line shows square in last cgpath..

iOS 6 Bug

There is a huge difference between iOS 5 and iOS 6.

How can I solve the problem that the App works under iOS 6 like in iOS 5?

iOS 6

the "black" offset is my problem. The Touch Event is not converted right, i guess. :/

Drawing texture

Have you considered drawing with textured? That would be awesome feature ...

cocos2d.h file not found

git submodule update --init --recursive
prompt
fatal: not a git repository (or any of the parent directories): .git

how to use KZLineDrawer ?

i have been added submodule in my project like you ,and cloned it. every thing seems to be done,but it is not working .is there any chance to tell me how to use ?

How can i declare function

Hi guy. First thanks for good job. But i wanna add undo redo etc functions. And i need declare functions and access them from another claa. but i couldnt do it. can you help me how can i do that. ex: from anather .m class [[LineDrawer node] undoButtonClicked];
doesnt work for lidraw on the screen. Thanks

Drawing with different style pens

Hello
You know the paper by 53 application and it has different type of pen,pencils etc...(Such as sketch pen,coloring pen..)
Do you think implementing something like it would be possible with your algorithm? If it is possible can you show me a way so may be I can implement and share it with you so your codes grows bigger.

Swift support?

Do you know if anyone have attempted to port this to swift? If not I can probably do it.

✌️

Make background color clearcolor

I have document and want to use this code to make annotations on it. So I want to see my controller in background and have director controller on it. So that user feel that line is drawn on the document.

Thanks in advance

ios4 support

Hello
I'm trying to use your smooth drawing code in my application but I've noticed that its working under ios5 perfect but its not working on ios 4
Do you know why it would be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.