Welcome to the Browser-Base Game Zone forums!
does anyone have ideas on making the map scroll smoothly?
Quote from: travo on July 23, 2009, 01:45:47 AMdoes anyone have ideas on making the map scroll smoothly?You can use jQuery UI: http://jqueryui.com/demos/draggable/Seem larger but gzip can reduce that a LOT
<style type="text/css" media="screen">#viewport{ position: relative; width: 320px; height: 240px; overflow: hidden;}#map{ position: absolute; top: 0; left: 0;}.tile{position: absolute;}.y1{top: 0px;}.y2{top: 64px;}.y3{top: 128px;}/* ... */.x1{top: 0px;}.x2{top: 64px;}.x3{top: 128px;}/* ... */</style><div id="viewport"> <div id="map"> <div class="tile y1 x1"></div> <div class="tile y1 x2"></div> <div class="tile y1 x3"></div> <div class="tile y1 x4"></div> <div class="tile y1 x5"></div> ... </div></div>
Well, can't the javascript be modified or influenced? I would be worried about security issues
"wouldnt I have to load the entire map before it would work?"well...I guess I understand a bit more... no draggable then, but see above
Quote from: Nox on July 23, 2009, 02:12:52 AMQuote from: travo on July 23, 2009, 01:45:47 AMdoes anyone have ideas on making the map scroll smoothly?You can use jQuery UI: http://jqueryui.com/demos/draggable/Seem larger but gzip can reduce that a LOTGood idea. I looked into jQuery UI but didn't come up with the idea of using dragable for maps.
If you're looking for a way to drag a map around in a viewport, check out MoveableMap:http://offtheline.net/2008/3/13/moveablemap-or-anything-else-in-a-viewportIt uses prototype - been meaning to write a jquery port, but haven't had time to...(also seems to be a little weird in Firefox 3.5 - works fine in Aethora, but I have to fix those examples in the article...)
Hey, sorry about the thread necromancy, but its kind of relevant to topic.Earlier in the post I was recommending using pre-processed blocks of mapping information, which is stored in a json file on the server, this information then gets downloaded and used to render a map, well I've finished some demo code using my mappy code as a base, its largely untested, so may do some random things, or be horrifically slow, but I think its call, and it demonstrates how you can use pre-processed map data to build some pretty awesome looking maps (imho)http://demo.httpmmo.com/mappy/I've still got to implement the dynamic building placement bit, but this shows off the geometry side of life.
Quote from: RangerSheck on July 24, 2009, 12:21:05 PMIf you're looking for a way to drag a map around in a viewport, check out MoveableMap:http://offtheline.net/2008/3/13/moveablemap-or-anything-else-in-a-viewportIt uses prototype - been meaning to write a jquery port, but haven't had time to...(also seems to be a little weird in Firefox 3.5 - works fine in Aethora, but I have to fix those examples in the article...)It would be very nice to see a jQuery version of this, i've been looking for this for ages ...
I can send you pics of my cocks if you want reference.