Canvas Text Gradients for Backgrounds and Strokes
Text gradients are super easy to achieve with HTML5 Canvas. Process Here’s the process: Step 1 Create your CanvasGradient object with createLinearGradient. Step 2 Add your Gradient Color Stops. Step 3...
View ArticleCanvas Rotating and Scaling Images Around a Particular Point
Transforming objects in your HTML5 Game or Experiment requires a bit of understanding regarding how they work. The behaviour and end result is not as intuitive as CSS3 transform functions like rotate()...
View ArticleFixing Node Mysql “Error: Cannot enqueue Handshake after invoking quit.”
TL;DR You need to establish a new connection by calling the createConnection method after every disconnection. I was using the popular Mysql module for Node.js which is node-mysql and everytime, after...
View ArticleParsing CSS In Javascript
Recently I have been working on a project where a user can change some values inside a UI widget via form elements like input fields, range, etc. that would in turn change CSS code inside a CodeMirror...
View ArticleTime Based Animations in HTML5 Games: Why and How to Implement them
So you got into Web Based Animations or Games (using that HTML5 thingie) and chances are high that you’re relying on setInterval, setTimeout or even better – requestAnimationFrame to reflow and repaint...
View ArticleRemote Mobile Web Application Debugging with Weinre
Weinre (WEb INspector REmote) – pronounced as ‘winery’ – is an excellent tool that reuses the code from the webkit web inspector to allow remote webpage debugging (basically what firebug or chrome dev...
View ArticleScaling Your HTML5 Canvas to Fit Different ViewPorts (or Resolutions)
I am going to share a neat little trick that was learnt while working on an HTML5 game recently. The game is pretty much like our HTML5 Doodle Jump. We had to make sure that the game scales down very...
View ArticleGames Physics: Basics and Implementation of Predictive (or Continuous)...
Few days ago, I wrote a post about why time based animations are better than frame based animations. However, in animations done as a function of time, some serious problems could arise. One of them is...
View ArticleUsing CoffeeScript over JavaScript in your Node.js Application or Module
If you’ve wanted to code your next Node.js app in CoffeeScript then it ain’t that hard. Since coffeescript is just a little language that compiles down to javascript it is pretty much compatible with...
View ArticleJavaScript Control Input Field Caret Position or Move to End in Textboxes and...
Long title, but then I felt like specifying parts of what I’ll be covering in this post. Anyway, so I’ll start by a not-so-common issue that some of us have encountered, which is, how to move the input...
View Article