Reading and writing files from the browser using flex. Now works for all browsers!

Monday, April 11, 2011 Posted by Ruslan Matveev 2 comments

Hi, I've finally got fsUtils flash wrapper working in all browsers. Now you can use it in Safari, Google Chrome, Opera, Firefox and Internet Explorer. Below you can see a nice little demo, that I've created on top of it. This demo application represents simple text editor that is using fsUtils to load and save files from your local hard drive. Also I've adjusted couple of things, so now when you open the file, you can get it's original file name along with it's contents. Enjoy it!

Isometric Grid Generator based on HTML5 canvas

Sunday, April 10, 2011 Posted by Ruslan Matveev 9 comments

The other day, I was busy with jGen Map Editor, web - based isometric map editor for my own JavaScript game engine, called jGen. I had to draw an adsjustable (so the user can change it's width and height) isometric grid in web - browser. My first idea was to find some different size isometric background images (most commonly used format is 64x32) and make some UI element to switch between them. But the problem is that when you're looking for something like this in the Google Image Search, it seems that there are many people who has quite different opinions on what isometric background should look like. So at the end I had to create my own drawing mechanism.

Using Internet Explorer's userData behavior to store data on the client.

Posted by Ruslan Matveev 0 comments

Internet Explorer is bad. And it doesn't get any better, because everything that we had to fight against in IE6 still raises issues in the next versions. A couple of months ago I've came across some strange and dark part of IE's past, called: behaviors. Behaviors are proprietary components that encapsulate specific functionality or behavior on a page and according to the Microsoft they represent one of the most exciting new features introduced in Microsoft Internet Explorer 5.5

Nice! Why I didn't know about it before?! You can use their own programming language to implement those behaviors (it's simple, XML - based and component - oriented language), and you're probably familiar with it, because every time when you needed to fix png bugs in old IE6 you had to include that weird htc file, which contains behavior definition.

But, there is another part, called default behaviors, which is always available out of the box, and you don't need to load external files if you want to use them. You can find full list of built - in behaviors here, and I'm going to tell you about one of them, called userData behavior, which is in my opinion, one of the most interesting ones listed in there.

Recreating google code wiki with wikiwym and google-code-prettify.

Saturday, April 9, 2011 Posted by Ruslan Matveev 2 comments

Today I'm going to show you how to transform text in google code wiki syntax format into HTML using wikiwym and google-code-prettify.

Wikiwym is a JavaScript - based parser for the Google Code wiki syntax. Using this parser you can easily transform Google Code wiki syntax into HTML. It's simple, fast and reliable solution to generate HTML code out of Wiki syntax source, and what is also very important this can be done in non - browser environment (like Mozilla Rhino or Google V8), so you can even make some automated tool which for example generates documentation out of wiki syntax markdown on top of it.

It's also very easy to use. You just need to include GoogleCodeWikiParser.js into your html page and then execute following code which will transform wiki markdown into HTML.

// create an instance of the parser
var wikiParser = new GoogleCodeWikiParser();
// this is necessary in order to keep line breaks in <pre /> and <code /> tags
.options.outputSeparator = '\n';
// transform wiki markdown into html
var htmlCode = wikiParser.parse(wikiCode);

Qt Creator color scheme: Monokai

Posted by Ruslan Matveev 8 comments

Port of Monokai color scheme (originally bundled with Sublime Text 2) for the Qt Creator.

Qt Creator Monokai color scheme

Enjoy it!