If you are working with HaxeNME, you might have noticed that compiled JS/HTML5 applications do not necessary work same as other platforms. Or don't work at all. Or don't compile because of some uncommon unimplemented method that you've used. Continue reading
And as code base is accumulating "tricks" by multiple contributors, it does not necessarily remain entirely stable.
For example, if you've decided to clear your BitmapData-based 640x480 buffer via BitmapData.fillRect, you are making a huge mistake - the function is not just doing this pixel-by-pixel, but also via ImageData API.
Overall, this article is dedicated to substituting Browser/Jeash part of NME by your own library in JS compilation.
no it is not.
I mean, really. The whole process is as much as checking if file changed, and kindly asking browser to reload a tab if it did. Second part is slightly harder, but, fortunately, there is WinAPI with it's SendMessage support. Continue reading
To keep things simple, I've just went and wrote the following micro-code in AutoIt:
Looks of gadget on desktop, in according pane, and on it's settings screen.
So I've randomly found out that Windows 7 (and Vista too) gadgets are written in HTML+JS+CSS.
Next thing I did was writing my own gadget. So this comes.
'Time is Ticking' is a minimalistic stopwatch. As such, it's purpose is to allow measuring for how long you were doing (or not doing) specific thing. Can be motivating.
Gadget can be considered optimized (does operation and a redraw once per second when on, is entirely idle when off), features customizable backgrounds with ability to specify your own (navigate to %USERPROFILE%\AppData\Local\Microsoft\Windows Sidebar\Gadgets\TimeIsTicking.gadget\image and add 160x32 PNG images to be able to chose them by-name in settings), and is pretty nice-looking overall.
For best experience it is recommended that you have font Dejavu Sans Mono installed, so digits would display appropriately.
To avoid accidental triggering, pause\restart buttons require double-clicking them to react.
Not much of informative demonstration, but is cross-platform and shows performance.
If you've noticed, multiple systems are better at drawing single large images than lots of small ones.
Same applies to HTML5, meaning that filling a 640x480 canvas with 40x40 images using two for() loops is not exactly a good thing to do each frame.
Common solution to this problem is to create a 'cache' image that would hold a tiled version of image to be drawn easily.
That means drawing image W*H times only once in a while.
However, actually you can do even better than this.
Video credit: 'asdfmovie song by LilBruceWayne'
As you may know, HTML5 standard includes <video> tag support.
This adds some
crazy interesting possibilities that can be used in games as well.
A common wish is to have a video playing as part of game or as its background overall.
Here I'm going to explain methods of doing this in Tululoo.