<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jGoBoard</title>
	<atom:link href="http://jgoboard.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jgoboard.com</link>
	<description>Photorealistic go board with JavaScript</description>
	<lastBuildDate>Sun, 18 Dec 2011 12:12:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>jGoBoard 2.1 now available</title>
		<link>http://jgoboard.com/2011/12/jgoboard-2-1-now-available/</link>
		<comments>http://jgoboard.com/2011/12/jgoboard-2-1-now-available/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 11:40:42 +0000</pubDate>
		<dc:creator>Joonas Pihlajamaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jgoboard.com/?p=70</guid>
		<description><![CDATA[New jGoBoard version is out! The API has not changed much, but new version has some nice additions: There is a new autodiv.js which enables you to just embed a div with some special attributes and jGoBoard will generate a SGF viewer for you with no additional JavaScript! I compiled a single minified all-min.js with [...]]]></description>
				<content:encoded><![CDATA[<p>New jGoBoard version is out! The API has not changed much, but new version has some nice additions:</p>
<ul>
<li>There is a new <code>autodiv.js</code> which enables you to just embed a div with some special attributes and jGoBoard will generate a SGF viewer for you with no additional JavaScript!</li>
<li>I compiled a single minified <code>all-min.js</code> with Google&#8217;s <a href="http://code.google.com/closure/compiler/">Closure Compiler</a> so you only need one, fast-loading script tag. Nice!</li>
</ul>
<p>Basically all you need to do is to head to <a href="/downloads/">Download page</a> and grab it, and look at the source of <a href="http://static.jgoboard.com/embed_demo.html">embedding demo</a> and you should have a pretty clear idea how to embed jGoBoard to your blog, website, or whatever. Have fun!</p>
<p>Oh, one final remark: Remote SGF loading uses JSONP service I have created that fetches an SGF file, parses it&#8217;s structure and returns it to your script in parsed form. To avoid abuse, I&#8217;ve put quotas on the amount that one domain can use the service &#8211; 1000 requests a day and max 10 MB data in or out. So if you are expecting to exceed this, either put your SGF files in a place you can reference them locally (i.e. no need for http:// in the URL), cache them that way or contact me to negotiate a bigger quota. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jgoboard.com/2011/12/jgoboard-2-1-now-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using hover markers and .each()</title>
		<link>http://jgoboard.com/2011/03/using-hover-markers-and-each/</link>
		<comments>http://jgoboard.com/2011/03/using-hover-markers-and-each/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 21:57:06 +0000</pubDate>
		<dc:creator>Joonas Pihlajamaa</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[each]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[marker]]></category>

		<guid isPermaLink="false">http://jgoboard.com/?p=59</guid>
		<description><![CDATA[A common need in interactive applications is to provide some kind of visual feedback to the user where he&#8217;s going to place a stone next. For this purpose, two special &#8220;hover&#8221; markers are provided: &#8220;&#60;&#8221; for black stones and &#8220;&#62;&#8221; for white stones. They do not display anything when the mouse cursor is not above [...]]]></description>
				<content:encoded><![CDATA[<p>A common need in interactive applications is to provide some kind of visual feedback to the user where he&#8217;s going to place a stone next. For this purpose, two special &#8220;hover&#8221; markers are provided: &#8220;&lt;&#8221; for black stones and &#8220;&gt;&#8221; for white stones. They do not display anything when the mouse cursor is not above them, but when mouse enters the marker area, a semi-transparent stone with no shadow is displayed. You can <a title="Using markers with jGoBoard 2.0" href="http://jgoboard.com/2011/03/using-markers-with-jgoboard-2-0/">learn more about markers</a> in my previous post.</p>
<p>This way of combining hover functionality with markers has some disadvantages &#8211; for example, you cannot have a hover on an intersection which also contains a marker, and if you have an application that places black and white stones in turn, you may need to change 350 markers on each move. However, based on testing it only seems to take around 1ms to change the markers on a modern browser, and because I did not want to add another 361 divs to jGoBoard in addition to the existing 1160, it&#8217;s just the way it&#8217;s currently done &#8211; adding a new hover layer can easily be done by more demanding applications, as long as you pass any mouse clicks to board.click handler if you want to retain that functionality.</p>
<p>Having said all that, here&#8217;s how you make a coordinate show a black stone when mouse cursor moves on top of it:</p>
<pre class="prettyprint">board.mark(new JGOCoordinate("H14"), "&lt;");</pre>
<p>Now let&#8217;s say you want to make all empty intersections have a white stone hover effect. One way to achieve this would be to make two for-loops to go through all coordinates, but to avoid creating such structure over and over again in the code, <strong>JGOBoard</strong> object provides an <em>each()</em> method very similar to the one in jQuery to call a function for every coordinate of the board. Similar to jQuery, the special <em>this</em> variable is set to board object in the function, so you can use all board methods easily in the function:</p>
<pre class="prettyprint">// Mark all empty intersections with white hover
board.each(function(coordinate) {
  if(this.get(coordinate) == JGO_CLEAR)
    this.mark(coordinate, '&gt;');
});</pre>
<p>That&#8217;s it! Note that the markers remain on board even when you add stones, so if you for example have a web page where the user is always providing moves for white player, after initial marking, you only need to update markers areas where stones are placed or removed.</p>
]]></content:encoded>
			<wfw:commentRss>http://jgoboard.com/2011/03/using-hover-markers-and-each/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using markers with jGoBoard 2.0</title>
		<link>http://jgoboard.com/2011/03/using-markers-with-jgoboard-2-0/</link>
		<comments>http://jgoboard.com/2011/03/using-markers-with-jgoboard-2-0/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 19:02:59 +0000</pubDate>
		<dc:creator>Joonas Pihlajamaa</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[marker]]></category>

		<guid isPermaLink="false">http://jgoboard.com/?p=54</guid>
		<description><![CDATA[The most significant addition in jGoBoard 2.0 is the ability to place markers on the board. This enables applications utilizing jGoBoard to display about 99,5 % of SGF files out there. Markers can also be used to indicate the last move, or a ko that is taking place. Basic design decision in jGoBoard 2 was [...]]]></description>
				<content:encoded><![CDATA[<p>The most significant addition in jGoBoard 2.0 is the ability to place markers on the board. This enables applications utilizing jGoBoard to display about 99,5 % of SGF files out there. Markers can also be used to indicate the last move, or a ko that is taking place.<br />
Basic design decision in jGoBoard 2 was to create separate layers above the board:</p>
<ol>
<li>Top layer that contains the markers</li>
<li>Middle layer that contains the stones</li>
<li>Bottom layer that contains the shadows cast by stones</li>
</ol>
<p>So how to create a marker? It&#8217;s very simple. Remember how we made the board object:<br />
<span id="more-54"></span></p>
<pre class="prettyprint">board = jgo_generateBoard($("#board"));</pre>
<p>The board object that the function call returns has all the helpful methods in the <strong>JGOBoard</strong> class (see the beginning of jgoboard.js for documented prototype definitions), but it also replaces the stock <em>set(coordinate,stone)</em> method with a version that updates the board visuals, and adds a new <em>mark(coordinate,marker)</em> to the object. Using <em>mark(&#8230;)</em> function is straightforward:</p>
<pre class="prettyprint">var tengen = new JGOCoordinate(9,9);
board.mark(tengen, '#'); // place a square marker</pre>
<p>Clearing a marker uses the same method, you just pass an empty string (&#8220;&#8221;) as the marker. The following standard markers are available:</p>
<ol>
<li><strong>#</strong> creates a square</li>
<li><strong>*</strong> creates a cross (X)</li>
<li><strong>/</strong> creates a triangle</li>
<li><strong>0</strong> (zero) creates a circle</li>
</ol>
<p>In addition, any non-recognized marker will be output as label, so 1-9, a-z, A-Z and longer strings can also be added.</p>
<h2>Territory markers</h2>
<p>In addition, there are special markers &#8220;.&#8221; (period) and &#8220;,&#8221; (comma) for territory, which also mark any stones below them dead (semi-transparent stone with no shadow). Note that marking a stone dead in such a way provides only a visual cue, it does not change the behavior of board class and its methods (such as <em>getGroup(coordinate)</em>) in any way.</p>
<h2>Finally</h2>
<p>Note that the markers are independent from underlying stones &#8211; if you place a black stone on a marked intersection, the color of the marker will change from black to white, but it does not disappear. Applications need to clear the markers when it&#8217;s needed.</p>
<p>There are also two special markers to make a coordinate show a semi-transparent black or white stone when user hovers a mouse above that coordinate: &#8220;&lt;&#8221; and &#8220;&gt;&#8221;. The next article in the series will show you how to use them, as well as introduce a nice helper function in the JGOBoard class &#8211; the <em>each()</em> iterator.</p>
]]></content:encoded>
			<wfw:commentRss>http://jgoboard.com/2011/03/using-markers-with-jgoboard-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jGoBoard 2.0 released!</title>
		<link>http://jgoboard.com/2011/03/jgoboard-2-0-library-released/</link>
		<comments>http://jgoboard.com/2011/03/jgoboard-2-0-library-released/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 20:38:49 +0000</pubDate>
		<dc:creator>Joonas Pihlajamaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jgoboard.com/?p=41</guid>
		<description><![CDATA[A substantially improved version of jGoBoard library is now available. The basic usage is the same, but some notable changes include: New board image with less distortion than the previous one Correct &#8220;descending&#8221; order for board letter coordinates (A1 is bottom left, not top left corner :) New stone graphics and shadows make a cleaner [...]]]></description>
				<content:encoded><![CDATA[<p>A substantially improved version of jGoBoard library is now available. The basic usage is the same, but some notable changes include:</p>
<ul>
<li>New board image with less distortion than the previous one</li>
<li>Correct &#8220;descending&#8221; order for board letter coordinates (A1 is bottom left, not top left corner :)</li>
<li>New stone graphics and shadows make a cleaner look (some may like the old ones more, but I&#8217;m not redoing these until I get my hands on slate &amp; shell stones)</li>
<li>Board is now a &lt;div&gt; instead of &lt;table&gt;, and stones are absolutely positioned divs &#8211; should be more straightforward to render for a browser (although it&#8217;s 1160 divs for a 19&#215;19 board, talk about heavy)</li>
<li>Complete support for standard SGF markers (circle, square, cross, triangle, number and letter labels)</li>
<li>Territory markers which highlight underlying stones &#8220;dead&#8221;</li>
<li>Some additional nifty code under hood, such as &lt;pre&gt;board.each&lt;/pre&gt; iteration functionality</li>
</ul>
<p>I&#8217;ll be doing some documentation soon on how to use all of this new functionality, but meanwhile you can download jGoBoard 2 and take a look at the internals, of give it a spin on the <a href="http://static.jgoboard.com/sgf2.html">renewed SGF viewer</a> with support for markers and territory display!</p>
<p>If you&#8217;re anxious to see the territory markers and don&#8217;t want to locate a SGF file from the net with markers or make your own, fast forward this one to the end and also see the second last move with markers: <a href="http://static.jgoboard.com/sgf2.html?url=http://static.jgoboard.com/sgf/example.sgf">example.sgf</a> (sorry for the bad play :).</p>
]]></content:encoded>
			<wfw:commentRss>http://jgoboard.com/2011/03/jgoboard-2-0-library-released/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>jGoBoard.com relaunched with WordPress</title>
		<link>http://jgoboard.com/2011/03/jgoboard-com-relaunched-with-wordpress/</link>
		<comments>http://jgoboard.com/2011/03/jgoboard-com-relaunched-with-wordpress/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 16:44:13 +0000</pubDate>
		<dc:creator>Joonas Pihlajamaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jgoboard.com/?p=7</guid>
		<description><![CDATA[To avoid spending too much time with manual HTML editing, I&#8217;ve upgraded the site to run on WordPress. This also enables people to comment on stuff, and me to post articles on using jGoBoard in different ways.]]></description>
				<content:encoded><![CDATA[<p>To avoid spending too much time with manual HTML editing, I&#8217;ve upgraded the site to run on WordPress. This also enables people to comment on stuff, and me to post articles on using jGoBoard in different ways.</p>
]]></content:encoded>
			<wfw:commentRss>http://jgoboard.com/2011/03/jgoboard-com-relaunched-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
