Vanilla JS Tutorials

JsIso Tutorials

RSS feed

01 - Creating a simple Map with JsIso

A very simple example of creating a flat 2D map. By change two values, a Boolean (isometric: true), and a Number (tileWidth: 40) as seen in the instructions, you can easily change this 2D map into an Isometric 2D.5 map.

A basic JsIso Tile Field feature shown is .rotate(); this takes the argument either "left" or "right". This is similar to .flip(); which accepts "vertical" or "horizontal".

The map is built from RGBA colors.

    require([
      'jsiso/canvas/Control',
      'jsiso/tile/Field',
      'requirejs/domReady!'
    ],
    function(CanvasControl, TileField) {

      // RGBA of color to use
      var tileColor = "(158, 154, 255, 1)";

      // Our Tile Map
      var tileMap = [
        [tileColor, 0, tileColor, 0, tileColor],
        [tileColor, tileColor, tileColor, 0, tileColor],
        [tileColor, 0, tileColor, 0, tileColor]
      ]

      // X & Y drawing position, and tile span to draw 
      var xrange = 8;
      var yrange = 8;

      // use CanvasControl to create a simple canvas element
      var context = CanvasControl.create("canvas", 600, 300, {}, "main");

      var tileLayer = new TileField(context, CanvasControl().height, CanvasControl().width);

      tileLayer.setup({
        layout: tileMap,
        isometric: false, // Flag used to layout grid in non isometric format
        tileHeight: 80,
        tileWidth: 80 // Try setting isometric to true and half tileWidth to 40, for an isometric map
      });

      // Rotate our entire Map 
      tileLayer.rotate("left");
      
      // Loop through our tiles and draw the map  
      for (i = 0; i < xrange; i++) {
        for (j = 0; j < yrange; j++) {
          tileLayer.draw(i,j);
        }
      }
        
    });

Check out the View Source to see tutorial.

Tutorial Outcome (View & Run Source)

71 comments

  1. Woah!Thanks for this, man! I owe you a lot. Been struggling with this thing for weeks now/=.

    concrete driveway cincinnati Fri, 17 May 2019

  2. very informative. I wonder why the other experts of this sector don’t understand this. mobile legends pc

    — samuelddarden Wed, 29 May 2019

  3. I will make this as an example for my report this coming Friday. Thank you for making it convenient for me. :) Very understandable!

    roof repair cost estimator Tue, 4 Jun 2019

  4. I simply stumbled upon your blog and desired to say that I possess really enjoyed browsing your current posts. keep doing your great job and always gain my support. cheers for sharing this beautiful article. click here

    — Joshua A. Price Mon, 10 Jun 2019

  5. These codes are very important for our website! Superb!

    Washington SEO Tue, 11 Jun 2019

  6. Thank you so much! for sharing this because I've been thinking about this topic weeks already.
    r410a

    — Daniel Perez Tue, 18 Jun 2019

  7. I appreciate sharing your knowledge regarding about this topic. Thank you!
    | urgent care elite

    — Meggy Mon, 8 Jul 2019

  8. Excellent work, many thanks for sharing

    Rubbish clearance | CCTV Systems

    SEO Agency Durham Thu, 18 Jul 2019

  9. Pretty insightful post. Never thought that it was this simple after all. I had spent a good deal of my time looking for someone to explain this subject clearly and you’re the only one that ever did that. Keep it up. kitchen remodel

    — fredluis Thu, 25 Jul 2019

  10. Thanks a lot for sharing. Keep posting codings and tutorials. begamer

    — Patricia J. Clark Thu, 25 Jul 2019

  11. Thanks so much for sharing the routine in making a map using JsIso. Just what I need.
    www.moneymatcher.co.za/

    — Elvin Holt Fri, 26 Jul 2019

  12. Much better if we can see a video tutorial for this.

    columbia heating and cooling Tue, 30 Jul 2019

  13. Thanks for this tutorial!

    -theuselessweb.com

    — Connor Shaw Tue, 6 Aug 2019

  14. I've been looking for this kind of article, and here I found this one. Awesome!

    check us out

    — Anna Thu, 8 Aug 2019

  15. That was awesome from jsiso. The multi layered map is just excellent!
    tile and grout cleaning perth

    — Jessin1508 Tue, 13 Aug 2019

  16. Thank God I found this tutorial! Such a huge relief for me this is so helpful. Thanks so much for sharing this!

    random website

    — Matt Tue, 13 Aug 2019

  17. Hmm! seems like we share the same point of view. Gainesville Tree Pro Haile Plantation

    — Cassandra Thu, 15 Aug 2019

  18. Thank you for writing the code, I've been looking for it for a long long time! official site

    — Lori R. Novak Thu, 22 Aug 2019

  19. Thanks for sharing this post, I'll keep updated to your post because it's very informative and useful for future reference. | customxmlittlerock.com

    — AnnaSmith Fri, 23 Aug 2019

  20. Thanks for this! We can do so much in applying this to our social security administration website.

    — Earl Bennet Sun, 25 Aug 2019

  21. Thank goodness I found this tutorial! This is really helpful for me. Thank you for publicly sharing this! | https://www.a1septicservicejax.com

    — Mary Kay Tue, 3 Sep 2019

  22. Hello! I just want to say this is very helpful. esports talent agency

    — Horea Kaii Tue, 3 Sep 2019

  23. Sapling climbing surges are reported to become the most crucial instrument whenever climbing trees and shrubs, electricity poles as well as telephone rods. These surges are combined with the climbing shoes to enable them to enable the actual climber to purchase a ideal grip as well as secure all of them from falling the moment climbing the tree or possibly a post. http://landscapingaustin.net

    Larry Taylor Thu, 12 Sep 2019

  24. Woods climbing surges are reported to get the key instrument while climbing bushes, electricity poles or maybe telephone poles. These surges are with the climbing shoes to be able to enable your climber to acquire a excellent grip along with secure these people from falling after climbing a new tree or perhaps a person of polish lineage. http://bastroplandscaping.com

    Larry Green Thu, 12 Sep 2019

  25. This routine/procedure gives me an idea on how to create our own map. This is really very helpful.

    www.assistedonlinefilings.com/ Sun, 15 Sep 2019

  26. Most of us definitely like your own blog site as well as all of your topics.
    dokkanbattlestones
    gardenscapestars
    bravesoulsspirit
    realracingresources
    battlelandsroyalecheats

    — jake Wed, 18 Sep 2019

  27. Again, this is actually one awesome blog website.
    dragonmaniaresources
    beachbuggycoins
    blockcitymoney
    hungrysharkworldcoins
    brawlstarsresources

    — jake Wed, 18 Sep 2019

  28. Anyway I definitely loving the style and design of your blog.
    castleclashgems
    boxingstarcoins
    bowmastersgems
    funrungems
    bowlingkingcash

    — jake Wed, 18 Sep 2019

  29. this is really great,unique and very informative post, i like it. thanks

    192.168.1.1 Sun, 22 Sep 2019

  30. Finally found this site. Been searching for this excellent tutorial a year ago. Thanks a lot!

    — Michele Hidalgo Tue, 24 Sep 2019

  31. Any update on these? https://alexandriafence.co | https://alexandriademolition.com

    — Michele Hidalgo Tue, 24 Sep 2019

  32. Creating a simple map is interesting. Champion Forest Exteriors

    Champion Forest Exteriors Wed, 25 Sep 2019

  33. I don't know why I don't understand it. Can someone explain it again? Thank you for your response. Houston 360

    Houston 360 Wed, 25 Sep 2019

  34. I will use this idea in my project report in school. Houston 360

    Houston Louvered Roof Wed, 25 Sep 2019

  35. I've learned a lot. Thanks for sharing. Spring Septic

    Spring Septic Wed, 25 Sep 2019

  36. Our academic pursuits, along with a range of extracurricular activities, help in honing a child's skills and ensuring that he/she grows to be a mature and responsible citizen.

    top school in greater noida

    premium school in greater noida

    — abc Thu, 26 Sep 2019

  37. Pictures look great! Nice job!
    click here
    click here
    click here
    click here

    — Scott Fri, 27 Sep 2019

  38. You have nice codes. Thanks for sharing this! https://scott-keever-seo-washington-dc.business.site/

    — Kirt Wed, 2 Oct 2019

  39. first toggle mode

    require([
    'jsiso/canvas/Control',
    'jsiso/tile/Field',
    'requirejs/domReady!'
    ],
    function(CanvasControl, TileField) {
    https://www.melbourneofficemovers.com.au/perthofficeremovalists.html

    Suryi Priyat Wed, 9 Oct 2019

  40. Great article! Thanks for explaining stuff in such a concise and easy to understand way!

    - Katie from Fencing Lexington KY

    Fencing Lexington Sun, 13 Oct 2019

  41. I'm happy to see the considerable subtle element here!. Clickbank Breaks The Internet

    — Clickbank Breaks The Internet Tue, 15 Oct 2019

  42. Great Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot. Hero Instinct

    — Hero Instinct Tue, 15 Oct 2019

  43. I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. Hero Instinct Review

    — Hero Instinct Review Tue, 15 Oct 2019

  44. It is the intent to provide valuable information and best practices, including an understanding of the regulatory process. Numerologist Review

    — Numerologist Review Tue, 15 Oct 2019

  45. You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog. Children Learning Reading

    — Children Learning Reading Tue, 15 Oct 2019

  46. I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. EZ Battery Reconditioning Review

    — EZ Battery Reconditioning Review Tue, 15 Oct 2019

  47. wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated. Jack Blowjob Lessons

    — life link Tue, 15 Oct 2019

  48. this blog was really great, never seen a great blog like this before. i think im gonna share this to my friends.. Unlock Her Legs

    — Unlock Her Legs Tue, 15 Oct 2019

  49. It should be noted that whilst ordering papers for sale at paper writing service, you can get unkind attitude. In case you feel that the bureau is trying to cheat you, don't buy term paper from it. lamp recycling companies

    — lamp recycling companies Fri, 18 Oct 2019

  50. I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read !! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. smart mold

    — smart mold Fri, 18 Oct 2019

  51. Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. General Contractor

    — General Contractor Sat, 19 Oct 2019

  52. cool you write, the information is very good and interesting, I'll give you a link to my site. Auto Tinting

    — Auto Tinting Sat, 19 Oct 2019

  53. I think this is a standout amongst the most critical data for me. What"s more, i"m happy perusing your article. Be that as it may, ought to comment on some broad things Construction

    — Construction Sat, 19 Oct 2019

  54. This is such a great resource that you are providing and you give it away for free. Auto Tinting

    — Auto Tinting Sat, 19 Oct 2019

  55. I was taking a gander at some of your posts on this site and I consider this site is truly informational! Keep setting up.. Auto Tinting

    — Auto Tinting Sat, 19 Oct 2019

  56. If you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries General Contractor

    — General Contractor Sat, 19 Oct 2019

  57. They're produced by the very best degree developers who will be distinguished for your polo dress creating. You'll find polo Ron Lauren inside exclusive array which include particular classes for men, women. Auto Tinting

    — Auto Tinting Sat, 19 Oct 2019

  58. I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts. General Contractor

    — General Contractor Sat, 19 Oct 2019

  59. This is also a very good post which I really enjoy reading. It is not everyday that I have the possibility to see something like this. General Contractor

    — General Contractor Sat, 19 Oct 2019

  60. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging, General Contractor

    — General Contractor Sat, 19 Oct 2019

  61. https://www.wpgio.com/
    https://www.wpgio.com/blog/reviews/bigtoken-review/
    https://www.wpgio.com/blog/reviews/type-n-cash-review/
    https://www.wpgio.com/blog/reviews/cashy-review/
    https://www.wpgio.com/blog/reviews/buzzbreak-review/
    https://www.wpgio.com/blog/reviews/leisure-shine-online-review/
    https://www.wpgio.com/blog/seo/on-page-seo/
    https://topratedtraveltrailers.com/
    https://indoorcardiopro.com/
    https://floridacityfl.us/
    https://pinchofherbal.com/
    https://bikeandbicycle.com/
    https://kidkoolerz.com/
    https://readysoccer.com/
    http://touchofhum.com/
    http://intermountainbikes.com/
    http://mommyactive.com/
    http://cyberdetectpro.com/
    http://scopeitoutdoors.com/

    — Joshua L. Maloney Sun, 20 Oct 2019

  62. Thanks for the great information on this - so helpful!

    - Katie from Fencing Bowling Green KY

    Katie Thu, 31 Oct 2019

  63. Easily build complex isometric 2D.5 layouts or flat ... Simple player device interaction; Apply the same code accross tile formats ... soy

    — andre volvi Sat, 2 Nov 2019

  64. Thanks for the information on this - this is great for building layouts or flats! Appreciate it!

    - Fencing Louisville KY

    Fencing Louisville Mon, 4 Nov 2019

  65. Thanks for every other informative site. The place else may just I get that kind of information written in such an ideal means? I have a venture that I’m just now operating on, and I have been on the look out for such information on fitnessbond.

    fitnessbond Tue, 5 Nov 2019

  66. this takes the argument either "left" or "right". This is similar to .flip(); which accepts http://www.fotoitaca.com

    — andre volvi Sat, 16 Nov 2019

  67. Number (tileWidth: 40) as seen in the instructions, you can easily change fotoi

    — george hivte Sat, 16 Nov 2019

  68. Good to hear this from a friend such a informative site
    www.londonairductcleaner.ca/

    — Philips Mon, 18 Nov 2019

  69. Try setting isometric to true and half tileWidth to 40, for an isometric map

    dados maldo Mon, 18 Nov 2019

  70. Yea this is pretty good. Great resource.

    pool service Fri, 22 Nov 2019

  71. I just used this and it was pretty cool. We learned this in 202 CSCE in my post-bac course last semester.

    pool cleaning company costa mesa Fri, 22 Nov 2019

Please insert the result of the arithmetical operation from the following image:

Please insert the result of the arithmetical operation from this image. =