How to push content centered with css to the left instead of down on narrower screen

Discussion in 'HTML & Website Design' started by ketting00, Apr 9, 2015.

  1. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #21
    Knock yourself out, I don't share code unless my point is for other people to run with it.

    Wow, looking back at that there's a LOT of stuff I'd do differently today. I really should revisit that as when I originally created that six or seven years ago (damn, it's been that long?) CANVAS was still brand spanky new, there was no IE implementation, and I wasn't quite as proficient in JS as I should have been.

    But as I often say, if you aren't disgusted with code you wrote just a year ago, you're probably in the wrong business. That demo is significantly older than that.

    Was actually intended to be a missile command type game -- closer in many ways to Polaris for the TRS-80 Coco.

    Laughably the problem wasn't canvas for me, it was the ridiculously high latency of HTML audio holding it back; a problem that REALLY hasn't been addressed across browsers IMHO. Was going to end up having to use Flash for the audio at which point why bother using CANVAS in the first place?

    ... see why Google's anniversary pac-man didn't use CANVAS or AUDIO.

    The fun part of that demo and what makes it somewhat unique is it points out that the context resolution/backbuffer size is independant of the CANVAS element's size. As such you can pick an arbitrary size like 640x350 for all internal calculations, then scale it to fit the display just like you would SVG. One just has to beware that really high resolutions take longer to scale costing you heavily in framerate on less capable platforms and/or browsers, and that not all browsers rescale using the same techniques. Old Opera renders per the target resolution resulting in a higher resolution output, FF and IE seem to use some form of anisotropic filtering, and Safari/Chrome/ChrOpera seem to just do a crappy bicubic resize. :/
     
    Last edited: Apr 10, 2015
    deathshadow, Apr 10, 2015 IP