Jump to content

Getting started with Canvas/Javascript


TacosLocos
 Share

Recommended Posts

Heya guys,

 

I'm comming to Canvas/Js from Flash/Actionscript. One thing I don't understand is where to find the Js language reference, comming from Flash I'm used to having all the Actionscript built-in functions/methods/classes/whatever nicely listed in the Flash IDE.

Now when I try and search for something similar, all I get is tutorials and chaos, such as:

https://developer.mozilla.org/en/docs/Web/JavaScript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference

https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API

 

What I'm looking for is some documentation that would list and show all the stuff that is built-in to the Canvas/Js tech that I can use, such as:

context.drawImage();

context.fillRect();

 

Any help is much appreciated,

 

Thanks,

Tacos

Link to comment
Share on other sites

This is very IDE-specific question. Most Editors can read JSDoc-style documentation and provide code completion.

The Term "Code Completion" is what you are after: https://www.google.de/search?q=java+script+code+completion

Here is the easy solution for Webstorm: http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/
http://ternjs.net/ comes with good code completion for several IDE and is available for atom/brackets too.

 

 

Link to comment
Share on other sites

Well yea, having code completion in editor is nice and all, but it gets confusing and tedious to work with at times.

What I'm looking for is something more like documentation that we had for Actionscript from Adobe. For example, here is documentation of BitmapData class with ALL of its methods and properties explained in nice detail:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html

 

edit:

And in the left column of that page you can see basically every Actionscript class, so you have a nice overview of what you can use. I'm looking for pretty much the same thing but for Javascript

Link to comment
Share on other sites

Yeah, this is a problem with JS. Generally speaking MDN is the source you should look at, W3C site is similar but has more inaccuracies. It gets trickier because JS has a specification, vendors can, if they want, implement things a little differently from the spec. Nowadays things are pretty tight and vendors have good relationships and help push the specification forward and, usually, stick to it. MDN is usually fairly reliable though.

The documentation of canvas is worse than JS though, its a separate API that is merely accessed via JS, so its not part of the JS spec. Part of the problem is that JS evolves, and tends to move quickly, so, documentation is harder to write and maintain. Having said that though, MDN is normally right up to date, and is quickly patched if there are any issues.

The page on the canvas 2d context seems to match the Flash docs you linked in terms of function.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...