meme-creator | backend tech , no frontend lib | Frontend Framework library
kandi X-RAY | meme-creator Summary
kandi X-RAY | meme-creator Summary
No backend tech, no frontend lib. Just JavaScript and Canvas. ( _ )
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of meme-creator
meme-creator Key Features
meme-creator Examples and Code Snippets
Community Discussions
Trending Discussions on meme-creator
QUESTION
So I am trying to build a Meme-Creator. You already can upload the pics as the background-img from the canvas. Now I am trying to do the Meme font but it isnt really working. However it is creating a big gap in the picture. Thanks for your help and attention! :D
...ANSWER
Answered 2018-Sep-22 at 12:55I've made a few changes to your script. because you need to draw the image several times I've written a function that draws the image. The canvas is cleared every time one of the 2 text input changes it's value, and every time you have to redraw everything.
Also textT and textB can be declared only once. You don't need to declare them in the Text function.
I need to use the font size (60) more than once, so I've made a variable fontSize = 60
Since you don't know the size of your canvas ( depends on the size of the uploaded image ) you need to calculate the position for the bottom text textB = height - fontSize/2
where height is the height of the canvas: height = canvas.height = img.height;
I hope it's useful.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install meme-creator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page