<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8619149015462818880</id><updated>2024-09-23T14:43:41.535+09:00</updated><category term="AndEngine"/><category term="雑記"/><category term="AsusEeePC1025C"/><category term="Draggable"/><category term="Sortable"/><category term="Ubuntu"/><category term="compass"/><category term="gd"/><category term="gem"/><category term="imagecopyresampled"/><category term="imagecrop"/><category term="jQuery"/><category term="jQueryUI"/><category term="php"/><category term="sass"/><category term="レンタルサーバ"/><category term="画像処理"/><title type='text'>NASUのメモ</title><subtitle type='html'>アプリ開発、その他メモ用</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-9187234053747355715</id><published>2015-11-27T15:50:00.000+09:00</published><updated>2015-11-27T16:17:27.956+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gd"/><category scheme="http://www.blogger.com/atom/ns#" term="imagecopyresampled"/><category scheme="http://www.blogger.com/atom/ns#" term="imagecrop"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="画像処理"/><title type='text'>GDでimagecropを使用したら画像に黒枠ができた場合の対処</title><content type='html'>PHPでGDのimagecropを使用し画像をトリミングをしたのですが、画像の周りに黒枠ができてしまいました。&lt;br /&gt;
&lt;a href=&quot;http://php.net/manual/ja/function.imagecrop.php&quot; target=&quot;_blank&quot;&gt;PHPマニュアル＞GD＞imagecrop&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpKuQATlv6VBO5UuWFGfR91UtCABtSxp6pzoTH1vNEXgM5bcq98h4SWcoC2HuBn_aRc2KWqFa2kAqt0Nsp-fLgNS5ep8w1ct2XJETturA6VFJSNCfqOCVfhYZCpmJNWSksFuTUZcBATk4/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2015-11-27+15.30.41.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpKuQATlv6VBO5UuWFGfR91UtCABtSxp6pzoTH1vNEXgM5bcq98h4SWcoC2HuBn_aRc2KWqFa2kAqt0Nsp-fLgNS5ep8w1ct2XJETturA6VFJSNCfqOCVfhYZCpmJNWSksFuTUZcBATk4/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2015-11-27+15.30.41.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
こんな感じで上下左右に数pxの黒枠が出てしまいました。&lt;br /&gt;
そんなときの対処法。&lt;br /&gt;
&lt;br /&gt;
imagecopyresampledを使う。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://php.net/manual/ja/function.imagecopyresampled.php&quot; target=&quot;_blank&quot;&gt;PHPマニュアル＞GD＞imagecopyresampled&lt;/a&gt;&lt;br /&gt;
bool imagecopyresampled (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;resource $dst_image ,resource $src_image ,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int $dst_x , int $dst_y ,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int $src_x , int $src_y ,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int $dst_w , int $dst_h ,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int $src_w , int $src_h )&lt;br /&gt;
&lt;br /&gt;
$dst_imageは&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;$dst_image = imagecreatetruecolor( $img_width, $img_height );
&lt;/pre&gt;
などとし、&lt;br /&gt;
$src_imageは元になる画像sourceを指定&lt;br /&gt;
$dst_xと$dst_yは0を指定。&lt;br /&gt;
$src_xと$src_yは切り取りたいx,y位置。&lt;br /&gt;
$dst_wと$src_w、 $dst_hと$src_h&lt;br /&gt;
はそれぞれ同じ値で幅と高さを指定。&lt;br /&gt;
これで黒枠が出ないようになる。&lt;br /&gt;
結果は&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ3T2abs7AD5VVz28jC0ZbHKrLeGIHus1LIQobMMpjk1cbfQ67JWzTetvS0W6WBhtwiquzfVrlxNnh5OzSes-2ZBJx_TlMPBC1BYeX0elwnNQgQiJ9kc7aVNHcz63OBhbEHkkQ7ygscgM/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2015-11-27+15.45.56.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ3T2abs7AD5VVz28jC0ZbHKrLeGIHus1LIQobMMpjk1cbfQ67JWzTetvS0W6WBhtwiquzfVrlxNnh5OzSes-2ZBJx_TlMPBC1BYeX0elwnNQgQiJ9kc7aVNHcz63OBhbEHkkQ7ygscgM/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2015-11-27+15.45.56.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
はい、すっきり。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;imagedestroyで使用したリソースは破棄することを忘れずに。&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/9187234053747355715/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2015/11/gdimagecrop.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/9187234053747355715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/9187234053747355715'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2015/11/gdimagecrop.html' title='GDでimagecropを使用したら画像に黒枠ができた場合の対処'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpKuQATlv6VBO5UuWFGfR91UtCABtSxp6pzoTH1vNEXgM5bcq98h4SWcoC2HuBn_aRc2KWqFa2kAqt0Nsp-fLgNS5ep8w1ct2XJETturA6VFJSNCfqOCVfhYZCpmJNWSksFuTUZcBATk4/s72-c/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2015-11-27+15.30.41.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-5119737501752748882</id><published>2015-10-30T15:01:00.001+09:00</published><updated>2015-10-30T15:02:55.593+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Draggable"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="jQueryUI"/><category scheme="http://www.blogger.com/atom/ns#" term="Sortable"/><title type='text'>jQuery UI のSortableでアイテムにclickイベントを併用した場合の問題</title><content type='html'>jQuery UIのSotrableを使用し、Sortable内の各アイテムにclickイベントを設置した場合、ドラグ後にclickイベントが発火してしまう問題。&lt;br /&gt;
Chromeではドラッグ後にclickイベントが発火することは無かったが、FireFoxなどでは、この問題が起きる。&lt;br /&gt;
解決方法はSotableのオプションに&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: javascript&quot;&gt; helper:&quot;clone&quot;
&lt;/pre&gt;
&lt;br /&gt;
を追加してあげる。&lt;br /&gt;
これで解決。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/5119737501752748882/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2015/10/jquery-ui-sortableclick.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5119737501752748882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5119737501752748882'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2015/10/jquery-ui-sortableclick.html' title='jQuery UI のSortableでアイテムにclickイベントを併用した場合の問題'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-793431339155458042</id><published>2014-09-18T11:31:00.004+09:00</published><updated>2014-09-18T11:55:06.539+09:00</updated><title type='text'>iOS8.0をXcode5.1でデバッグする方法</title><content type='html'>テスト端末のiOSを8.0にアップデートしたところ、Xcodeで認識しなくなった。&lt;br /&gt;
デバイスの選択で&lt;br /&gt;
[プロジェクト名] &amp;gt; [iOS Device]&lt;br /&gt;
となり、端末が選択できない。&lt;br /&gt;
&lt;br /&gt;
まず、以下の場所を確認&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;この場所にサポートしているiOSのバージョン毎のディレクトリーがあるが、&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;「&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;7.1 (11D167)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;」はあるが、やはり8.0は無い。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;アップデートを待つのも一つ。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;ある掲示板に次のような記述があった。リンクを作るそうだ。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 13px; line-height: 17.2800006866455px;&quot;&gt;sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSup‌​port/7.1\ (11D167) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSup‌​port/8.0\ (12A4265u)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;試してみたところ、一応動いた。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;Xcode6がリリースされるまでこれで待とうと思う。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;ちなみに、Xcode6のベータ版をインストールしている場合は、下記で動くそうだ。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;sudo ln -s /Applications/Xcode6-Beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.0\ (12A4331d) /Volumes/MAVERICKS/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.0\ (12A4331d)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 17.8048000335693px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/793431339155458042/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2014/09/ios80xcode51.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/793431339155458042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/793431339155458042'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2014/09/ios80xcode51.html' title='iOS8.0をXcode5.1でデバッグする方法'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-4662268770995977113</id><published>2014-05-26T00:07:00.001+09:00</published><updated>2014-05-26T00:07:38.999+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="compass"/><category scheme="http://www.blogger.com/atom/ns#" term="gem"/><category scheme="http://www.blogger.com/atom/ns#" term="sass"/><category scheme="http://www.blogger.com/atom/ns#" term="レンタルサーバ"/><category scheme="http://www.blogger.com/atom/ns#" term="雑記"/><title type='text'>レンタルサーバでsass,compassを使う為のgemの設定</title><content type='html'>私の使用しているレンタルサーバはさくらレンタルサーバです。&lt;br /&gt;
この環境で、sassを使うために設定した内容を一部紹介します。&lt;br /&gt;
というか、さくらレンタルサーバでgemを使用するための.bash_profileもしくは&lt;span style=&quot;background-color: white; color: #444444; font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27.428571701049805px;&quot;&gt;.cshrcの設定について。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27.428571701049805px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #444444; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 27.428571701049805px;&quot;&gt;さくらレンタルサーバなどで通常、gem を使用してインストールする場合、何も設定していない場合は&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 27.428571701049805px;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
ERROR: While executing gem ... (Gem::FilePermissionError)
  You don&#39;t have write permissions into the /usr/local/lib/ruby/gems/1.8 directory.
&lt;/pre&gt;

&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
などと言われてしまいます。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
当然レンタルサーバで、/usr/local/配下は書き込めないでしょう。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
なので、次のような設定をします。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
.cshrcの場合&lt;/div&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
setenv GEM_HOME $HOME/local/rubygems/gems
setenv RUBYLIB $HOME/local/rubygems/lib
setenv RB_USER_INSTALL true
setenv PATH ${PATH}:$HOME/local/rubygems/bin
&lt;/pre&gt;


&lt;div class=&quot;p1&quot;&gt;

&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
.bash_profileの場合&lt;/div&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
PATH=$PATH:$HOME/local/rubygems/bin
GEM_HOME=$HOME/local/rubygems/gems
RUBYLIB=$HOME/local/rubygems/lib
RB_USER_INSTALL=true
export GEM_HOME
export RUBYLIB
export RB_USER_INSTALL
export PATH
&lt;/pre&gt;

&lt;div class=&quot;p1&quot;&gt;



&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
などとし、設定を反映して下さい。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
さて、sassとcompassをインストールしてみましょう。&lt;/div&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
$ gem install sass
Fetching: sass-3.3.7.gem (100%)
Successfully installed sass-3.3.7
1 gem installed
Installing ri documentation for sass-3.3.7...
Installing RDoc documentation for sass-3.3.7...
$
$ gem install compass
Fetching: sass-3.2.19.gem (100%)
Fetching: chunky_png-1.3.1.gem (100%)
Fetching: fssm-0.2.10.gem (100%)
Fetching: compass-0.12.6.gem (100%)
Successfully installed sass-3.2.19
Successfully installed chunky_png-1.3.1
Successfully installed fssm-0.2.10
Successfully installed compass-0.12.6
4 gems installed
Installing ri documentation for sass-3.2.19...
・
・
・
Installing RDoc documentation for compass-0.12.6...
$
&lt;/pre&gt;


&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
OKでした。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/4662268770995977113/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2014/05/sasscompassgem.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/4662268770995977113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/4662268770995977113'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2014/05/sasscompassgem.html' title='レンタルサーバでsass,compassを使う為のgemの設定'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-3465722559177897690</id><published>2012-06-29T01:25:00.000+09:00</published><updated>2012-06-29T01:29:08.855+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AsusEeePC1025C"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>ASUS EeePC 1025c &amp; Ubuntu12.04 ...解像度変更編</title><content type='html'>&lt;br /&gt;
Ubuntu12.04をASUSのEeePCシリーズに入れた場合、ディスプレイの解像度が800x600で変更できないという報告をよく目にします。&lt;br /&gt;
今回は&lt;span style=&quot;background-color: white;&quot;&gt;ASUSのEeePC1025Cの&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;1024x600に変更できたので報告致します。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
6月にEeePC1025Cを購入。&lt;br /&gt;
メモリを4GBに、HDDをSSDに換装。&lt;br /&gt;
そしてOSはUbuntu12.04に変更。&lt;br /&gt;
Ubuntuのバージョンが11.xの時はUnityの評価が低く、自分でも不満があったので１１.xの導入はしなかったのですが、今回はディスプレイが10.1インチなので、このUIなら使い易いだろうと思い、12.04にしました。&lt;br /&gt;
Windowsの左下のメニューを頑張って操作しなくてもよいからと言う意味で。&lt;br /&gt;
&lt;br /&gt;
EeePCにUbuntu12.04を入れた状態で、どのようになったかを軽くまとめます。&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;メモリの認識は&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;/proc/meminfoで確認して4GBちゃんと認識されています。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;備え付けのSDカードリーダも動作しています。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;ディスプレイの上についているカメラも認識しています。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;備え付けのマイクも認識しています。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;キーボードのFnで割り当てられている機能について、ディスプレイの明るさ調整はできないようです。それ以外はほとんど使えます。スクリーンショットもできます。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;Unityですが、やはり標準ではUnity2Dです。特に２Dでも問題がないので、今のところ３Dに変更する予定はありません。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;動作速度ですが、全く問題ないです。というより、期待していた以上にキビキビ動いてくれます。&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;最後にバッテリーですが、このPCはハードウエアとソフトウエアでバッテリーの持ちを良くし、仕様では10時間と言う表記となっています。ただし、購入時の環境&lt;/span&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;（Windows）&lt;/span&gt;&lt;span style=&quot;background-color: white; line-height: 22px; text-align: left;&quot;&gt;で。&lt;/span&gt;&lt;span style=&quot;line-height: 22px; text-align: left;&quot;&gt;Ubuntuにした場合、バッテリーの持ち時間の表示は、6時間強となりました。SSDを使用しているので、HDDのままだと恐らくもう少し短くなるかもしれません。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
さて、本題です。&lt;br /&gt;
ディスプレイの設定が解像度800x600で変更できない。&lt;br /&gt;
xrandrの結果は次のようになっています。&lt;br /&gt;
---------------------------------------------------------------&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Ubuntu, &#39;Bitstream Vera Sans&#39;, &#39;DejaVu Sans&#39;, Tahoma, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;xrandr: Failed to get size of gamma for output default&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Ubuntu, &#39;Bitstream Vera Sans&#39;, &#39;DejaVu Sans&#39;, Tahoma, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;Screen 0: minimum 800 x 600, current 800 x 600, maximum 800 x 600&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Ubuntu, &#39;Bitstream Vera Sans&#39;, &#39;DejaVu Sans&#39;, Tahoma, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;default connected 800x600+0+0 0mm x 0mm&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Ubuntu, &#39;Bitstream Vera Sans&#39;, &#39;DejaVu Sans&#39;, Tahoma, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;800x600 0.0*&quot;&lt;/span&gt;&lt;br /&gt;
---------------------------------------------------------------&lt;br /&gt;
maximumが800x600なので、設定ツール等を使用してもそれ以外に変更ができない。&lt;br /&gt;
&lt;br /&gt;
解決方法として、xrandrを使用したり、xorg.confで設定したりという方法があります。&lt;br /&gt;
それについては未確認です。&lt;br /&gt;
&lt;br /&gt;
こちらのフォーラムで同様の問題に対し、解決策が載っているのを見つけました。&lt;br /&gt;
http://forum.ubuntu-fr.org/viewtopic.php?pid=9088911&lt;br /&gt;
フランス語ですが。&lt;br /&gt;
&lt;br /&gt;
この方法は、カーネルを更新することで、グラフィックモジュールが認識され、ディスプレイの解像度を変えることが出きると。&lt;br /&gt;
&lt;br /&gt;
ASUS EeePC1025CのグラフィックはIntel atom内臓のグラフィックモジュールを使用しています。&lt;br /&gt;
このモジュールはGMA3650というものです。&lt;br /&gt;
&lt;br /&gt;
Ubuntu12.04のkernelバージョンは3.2.0で、どうやらこのkernelはこのGMA3650には対応していないもよう。&lt;br /&gt;
&lt;br /&gt;
それに対し、今回更新しようとしているバージョンは3.4.xは対応している。&lt;br /&gt;
&lt;br /&gt;
ということで、試してみた。&lt;br /&gt;
手順は以下。&lt;br /&gt;
&lt;br /&gt;
1. カーネルをダウンロードして解凍&lt;br /&gt;
&lt;br /&gt;
$ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.4.tar.bz2&lt;br /&gt;
$&amp;nbsp;tar jxvf linux-3.4.4.tar.bz2&lt;br /&gt;
&lt;br /&gt;
2. make menuconfigで.configの設定&lt;br /&gt;
(他のツールでも、直接変更してもよい）&lt;br /&gt;
&lt;br /&gt;
解凍したディレクトリに移動&lt;br /&gt;
$ cd&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;linux-3.4.4/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;$ make&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;menuconfig&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
ここで、もしmenuconfigを立ち上げるのに必要なライブラリがない場合は、エラーが出力される。&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;*** Unable to find the ncurses libraries or the&lt;br /&gt;
&amp;nbsp;*** required header files.&lt;br /&gt;
&amp;nbsp;*** &#39;make menuconfig&#39; requires the ncurses libraries.&lt;br /&gt;
&amp;nbsp;***&lt;br /&gt;
&amp;nbsp;*** Install ncurses (ncurses-devel) and try again.&lt;br /&gt;
&amp;nbsp;***&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------&lt;br /&gt;
なので、必要なライブラリをインストールする。&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
再度チャレンジ&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;$ make&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;menuconfig&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3. menuconfigで.configを編集&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Device drivers ---&amp;gt; Graphics support ---&amp;gt; Direct rendering manager ---&amp;gt;&lt;br /&gt;
ここで&quot;Intel GMA5/600 KMS Framebuffer&quot;という項目を探し、&quot;m&quot;と入力&lt;br /&gt;
この項目の下に&quot;Intel GMA3600/3650 support&quot;と言う項目が出るので、&quot;y&quot;と入力。&lt;br /&gt;
&lt;br /&gt;
フォーラムに載っている内容ではもう一つ項目を設定。&lt;br /&gt;
&lt;br /&gt;
Device drivers ---&amp;gt; Staging drivers ---&amp;gt;&lt;br /&gt;
&amp;nbsp;&quot;Realtek RTS5139 USB card reader support&quot;&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;の項目に&quot;n&quot;を入力&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;理由は分からない。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
これでmenuconfigは終了。&lt;br /&gt;
&lt;br /&gt;
4. コンパイルの実行&lt;br /&gt;
&lt;br /&gt;
まず、カーネルコンパイル用のパッケージをインストール&lt;br /&gt;
$ sudo apt-get install kernel-package&lt;br /&gt;
&lt;br /&gt;
そして、make clean&lt;br /&gt;
$ make-kpkg clean&lt;br /&gt;
&lt;br /&gt;
makeする。&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;CONCURRENCY_LEVEL=`getconf _NPROCESSORS_ONLN` fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
ここから恐らく1時間以上かかった。&lt;br /&gt;
&lt;br /&gt;
5. インストール&lt;br /&gt;
&lt;br /&gt;
makeが終了したら、&lt;span style=&quot;background-color: white;&quot;&gt;一旦上の階層に戻る&lt;/span&gt;&lt;br /&gt;
$ cd ..&lt;br /&gt;
&lt;br /&gt;
このディレクトリに&lt;span style=&quot;background-color: white; font-family: Arial, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;custom kernel_imageとkernel_headersの2ファイルのdebファイルができているので&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;次のコマンドでインストール&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;$&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;sudo dpkg -i *.deb&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
6. 起動の設定&lt;br /&gt;
&lt;br /&gt;
$ cd /lib/modules&lt;br /&gt;
このディレクトリに3.4.4-customが作成されている。&lt;br /&gt;
&lt;br /&gt;
initramfsに、この&lt;span style=&quot;background-color: white;&quot;&gt;3.4.4-customを登録する。&lt;/span&gt;&lt;br /&gt;
$ sudo update-initramfs -ck 3.4.4-custom&lt;br /&gt;
&lt;br /&gt;
grubを更新。&lt;br /&gt;
$ sudo update-grub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
これでカーネルの更新は終了。&lt;br /&gt;
リブートする。&lt;br /&gt;
&lt;br /&gt;
恐らく再起動後にディスプレイの設定が変だから、とりあえず1024x600にするよ。&lt;br /&gt;
といったメッセージが表示される。&lt;br /&gt;
&lt;br /&gt;
ログイン。&lt;br /&gt;
&lt;br /&gt;
画面を見ていただきたい。&lt;br /&gt;
1024x600の画面になっているはずである。&lt;br /&gt;
&lt;br /&gt;
設定から、ディスプレイの解像度の設定を見てみると1024x600&lt;br /&gt;
ただし、それ以外の選択肢はない。&lt;br /&gt;
&lt;br /&gt;
しかしながら、ディスプレイがとても見やすい。&lt;br /&gt;
そして、カーネルをコンパイルしたので、動作がさらに早くなった。&lt;br /&gt;
気がする。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
N2600を使ったASUS EeePC101CHなどでも&lt;span style=&quot;background-color: white;&quot;&gt;同様に変更できると思われる。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm-jp.amazon.co.jp/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=purplegogo-22&amp;amp;o=9&amp;amp;p=8&amp;amp;l=as4&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;ref=ss_til&amp;amp;asins=B007LTYBXU&quot; style=&quot;height: 240px; width: 120px;&quot;&gt;&lt;/iframe&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm-jp.amazon.co.jp/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=purplegogo-22&amp;amp;o=9&amp;amp;p=8&amp;amp;l=as4&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;ref=ss_til&amp;amp;asins=B007LTYC4S&quot; style=&quot;height: 240px; width: 120px;&quot;&gt;&lt;/iframe&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm-jp.amazon.co.jp/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=purplegogo-22&amp;amp;o=9&amp;amp;p=8&amp;amp;l=as4&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;ref=ss_til&amp;amp;asins=B007PXNB5Q&quot; style=&quot;height: 240px; width: 120px;&quot;&gt;&lt;/iframe&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm-jp.amazon.co.jp/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=purplegogo-22&amp;amp;o=9&amp;amp;p=8&amp;amp;l=as4&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;ref=ss_til&amp;amp;asins=B007J77ZH8&quot; style=&quot;height: 240px; width: 120px;&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/3465722559177897690/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/06/asus-eeepc-1025c-ubuntu1204.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/3465722559177897690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/3465722559177897690'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/06/asus-eeepc-1025c-ubuntu1204.html' title='ASUS EeePC 1025c &amp; Ubuntu12.04 ...解像度変更編'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-8483091242336864480</id><published>2012-01-31T02:11:00.002+09:00</published><updated>2012-02-02T16:19:22.629+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】背景を画像にする</title><content type='html'>&lt;br /&gt;
背景に画像を使いたい場合の方法。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
onLoadResources()内で&lt;br /&gt;
背景テクスチャのTextureRegionクラスのインスタンスを生成&lt;br /&gt;
&lt;br /&gt;
onLoadScene()内で&lt;br /&gt;
背景画像からSpriteのインスタンスを生成、&lt;br /&gt;
SpriteからSpriteBackgroundのインスタンスを生成してsetBackgroundメソッドに読み込ませてあげる。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
■SpriteBackgroundクラスのコンストラクタ&lt;br /&gt;
SpriteBackground(final BaseSprite pBaseSprite)&lt;br /&gt;
SpriteBackground(final float pRed, final float pGreen, final float pBlue, final BaseSprite pBaseSprite)&lt;br /&gt;
&lt;br /&gt;
■SceneクラスのsetBackgroundメソッド&lt;br /&gt;
void setBackground(final IBackground pBackground)&lt;br /&gt;
&lt;br /&gt;
参考にしたソース&lt;br /&gt;
&lt;br /&gt;
AndEngine-Forumsより&lt;br /&gt;
&lt;a href=&quot;http://www.andengine.org/forums/gles1/set-as-a-background-image-t6291.html&quot; target=&quot;_blank&quot;&gt;Set as a background image&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
では実際に使用した際から抜粋&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;

/**  省略  **/

private BitmapTextureAtlas mBackgroundTextureAtlas;
private TextureRegion mBackgroundGrassTextureRegion;

public void onLoadResources() {
  BitmapTextureAtlasTextureRegionFactory.setAssetBasePath(&quot;gfx/&quot;);
  this.mBackgroundTextureAtlas = new BitmapTextureAtlas(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
  this.mBackgroundGrassTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mBackgroundTextureAtlas, this, &quot;bg1.png&quot;, 0, 0);
  this.mEngine.getTextureManager().loadTextures(this.mBackgroundTextureAtlas);
}
 
public Scene onLoadScene() {
  this.mEngine.registerUpdateHandler(new FPSLogger());
  this.mScene = new Scene();
  
  final Sprite sp = new Sprite(0, 0, mBackgroundGrassTextureRegion);
  this.mScene.setBackground(new SpriteBackground(sp));
  
  /** 省略 **/
  
  return this.mScene;
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/8483091242336864480/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andengine.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/8483091242336864480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/8483091242336864480'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andengine.html' title='【AndEngine】背景を画像にする'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-3797393509615772026</id><published>2012-01-18T00:32:00.000+09:00</published><updated>2012-01-18T00:32:23.274+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TimerHandlerの使い方</title><content type='html'>タイマーを使用してｎ秒後に〇〇したい。という要望を叶える。&lt;br /&gt;
&lt;br /&gt;
まずTimerHandlerクラスについてjavadocを見てみよう。&lt;br /&gt;
&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/engine/handler/timer/TimerHandler.html&quot;&gt;Class TimerHandler&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
コンストラクタは２つ&lt;br /&gt;
TimerHandler(float pTimerSeconds, boolean pAutoReset, &lt;br /&gt;
　　　　　　　ITimerCallback pTimerCallback)&lt;br /&gt;
TimerHandler(float pTimerSeconds, ITimerCallback pTimerCallback)&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;第一引数は秒で指定。&lt;/div&gt;&lt;div&gt;上の方は第二引数にboolean型でAutoResetの指定ができる。&lt;/div&gt;&lt;div&gt;メソッドのsetAutoReset(boolean pAutoReset) でも同様に設定できる。&lt;/div&gt;&lt;div&gt;AutoResetをtrueにすると指定した秒で繰り返しpTimerCallbackが呼ばれる。&lt;/div&gt;&lt;div&gt;falseの場合は指定した秒が経過するとpTimerCallbackが１度呼ばれる。&lt;/div&gt;&lt;div&gt;reset()を実行すると再度Timerが起動する。&lt;/div&gt;&lt;div&gt;引数のpTimerCallbackはITimerCallbackインターフェイスを実装した自身を呼ぶためにthisを指定したり、ITimerCallbackインターフェイスをnewしても良い。&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/engine/handler/timer/ITimerCallback.html&quot; target=&quot;_blank&quot;&gt;Interface ITimerCallback&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;では、サンプル&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;final TimerHandler timerHandler = new TimerHandler(1.0f, true, new ITimerCallback() {

  public void onTimePassed(TimerHandler pTimerHandler) {
  
    /** 処理したい内容を記述 **/
    Debug.d(&quot;TimePassed&quot;);
  }

});
mScene.registerUpdateHandler(timerHandler);
&lt;/pre&gt;&lt;div&gt;TimerHandlerのインスタンスをregisterUpdateHandlerに渡すことを忘れずに。&lt;/div&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/3797393509615772026/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetimerhandler.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/3797393509615772026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/3797393509615772026'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetimerhandler.html' title='【AndEngine】TimerHandlerの使い方'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-8258565784168578682</id><published>2012-01-15T16:27:00.000+09:00</published><updated>2012-01-15T16:27:51.895+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例 衝突判定</title><content type='html'>今回は衝突判定についてです。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
以前から使っているDigitalOnScreenControlを使ってプレイヤーを移動させ、Sceneに描画した四角と衝突している間、色を変える例です。&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;使用している変数、DigitalOnScreenControl等は&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol_09.html&quot; target=&quot;_blank&quot;&gt;以前のコード&lt;/a&gt;を参考にして下さい。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre class=&quot;brush: java&quot;&gt;final Rectangle exampleRectangle = new Rectangle(100, 100, 32, 32);  //四角を描画
exampleRectangle.setColor(0f, 0f, 1f);  //青
mScene.attachChild(exampleRectangle);

mScene.registerUpdateHandler(new IUpdateHandler(){

  public void onUpdate(float pSecondsElapsed) {
    //四角とplayerが衝突したか
    if(exampleRectangle.collidesWith(player)){
      exampleRectangle.setColor(1f, 0f, 0f);  //赤
    } else {
      exampleRectangle.setColor(0f, 0f, 1f);  //青
    }
  }

  public void reset() {
  }

});

&lt;/pre&gt;&lt;div&gt;実行結果は以下になります。&lt;/div&gt;&lt;div&gt;衝突前&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk74jsuXqSiUOYByvyMs32X2-9TUVE_JDWY28zLFfl1Uf4FazSeGqeq4QMcFiEtnDaHETBogzaN_acGyhOPqWTWAtAeso5RQ_PS6ALdU9oD6hJlRvbuzi22jPCW9cvYnGJxw3yBQ4mqP4/s1600/screenshot_2012-01-15_1621.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk74jsuXqSiUOYByvyMs32X2-9TUVE_JDWY28zLFfl1Uf4FazSeGqeq4QMcFiEtnDaHETBogzaN_acGyhOPqWTWAtAeso5RQ_PS6ALdU9oD6hJlRvbuzi22jPCW9cvYnGJxw3yBQ4mqP4/s320/screenshot_2012-01-15_1621.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;衝突時&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMZ-lVSTYdLwsAKGrVPkA_PVGp4ADaJSaKciGGNHTNvABLrW9O7gL-fkkB-9LQuABH2AAYnACMX-2uCQZUZIfLnmNy4GRR3sOfv_ayHVWNfxpAV_lrITv4FUXwwrx7-Gzr5ymV7XKMdjE/s1600/screenshot_2012-01-15_1622.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMZ-lVSTYdLwsAKGrVPkA_PVGp4ADaJSaKciGGNHTNvABLrW9O7gL-fkkB-9LQuABH2AAYnACMX-2uCQZUZIfLnmNy4GRR3sOfv_ayHVWNfxpAV_lrITv4FUXwwrx7-Gzr5ymV7XKMdjE/s320/screenshot_2012-01-15_1622.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;衝突前は青。衝突時は赤となるようにしました。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/8258565784168578682/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map_15.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/8258565784168578682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/8258565784168578682'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map_15.html' title='【AndEngine】TMX map を使った簡単な例 衝突判定'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk74jsuXqSiUOYByvyMs32X2-9TUVE_JDWY28zLFfl1Uf4FazSeGqeq4QMcFiEtnDaHETBogzaN_acGyhOPqWTWAtAeso5RQ_PS6ALdU9oD6hJlRvbuzi22jPCW9cvYnGJxw3yBQ4mqP4/s72-c/screenshot_2012-01-15_1621.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-5169922970543713863</id><published>2012-01-13T00:22:00.000+09:00</published><updated>2012-02-02T23:58:36.782+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例 HUDを使う</title><content type='html'>HUDは、ヘッドアップディスプレイの略であり、ディスプレイ上の固定位置に配置されているユーザーインターフェースのすべての部分を表します。&lt;br /&gt;
&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol.html&quot; target=&quot;_blank&quot;&gt;以前紹介した&lt;/a&gt;DigitalOnScreenControlのように画面がスクロールしてもディスプレイ上の固定位置に配置されています。&lt;br /&gt;

&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
では、今回はHUDを継承した簡単なサンプルを提示したいと思います。&lt;/div&gt;
&lt;div&gt;
画面上の上部に白い四角を描きたいと思います。&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
まずはHUDを継承したTestBarクラスを作成&lt;/div&gt;
&lt;pre class=&quot;brush: java&quot;&gt;import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.camera.hud.HUD;
import org.anddev.andengine.entity.primitive.Rectangle;

public class TestBar extends HUD {

  public TestBar(float pX, float pY, final Camera pCamera) {
    this.setCamera(pCamera);

    final Rectangle btnSubRect = new Rectangle(pX, pY, pCamera.getWidth(), 30);
    btnSubRect.setColor(1, 1, 1);
    this.attachChild(btnSubRect);

    pCamera.setHUD(this);
  }
}
&lt;/pre&gt;
&lt;div&gt;
BaseGameActivityを継承したクラスのonLoadScene()でSceneにsetChildSceneとして作成したクラスのインスタンスを渡す。&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush: java&quot;&gt;private Scene mScene;
public Scene onLoadScene() {

  mScene = new Scene();
  
  /** ・・省略・・ **/
  
  final TestBar testbar = new TestBar(0, 0, this.mBoundChaseCamera);
  
  /** ・・省略・・ **/
  
  return mScene;
}
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
以上の内容を実行すると下の画像のようになります。&lt;/div&gt;
&lt;div&gt;
DigitalOnScreenControlでプレイヤーを移動させても画面の上部に白い四角は固定された位置に描画され続けます。&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6P7lj_zzLD8qqsy9ucQ6pKHsxumlvM72qk89Dyw9ykBRx67DTAkyx2O9WiGIXwgy2yY6vB9fvoOMKhQHeZ_zOHc5pqSO7-5_2yR1VBrQWkS04KEpjygKriaLoB4S3MjA7vdh_RXjdanY/s1600/screenshot_2012-01-13_0005.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6P7lj_zzLD8qqsy9ucQ6pKHsxumlvM72qk89Dyw9ykBRx67DTAkyx2O9WiGIXwgy2yY6vB9fvoOMKhQHeZ_zOHc5pqSO7-5_2yR1VBrQWkS04KEpjygKriaLoB4S3MjA7vdh_RXjdanY/s320/screenshot_2012-01-13_0005.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://wiki.andengine.org/HUD&quot;&gt;AndEngine.orgのHUDの記事&lt;/a&gt;にHUDの説明とCreatingとRemovingについて例が載っています。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/5169922970543713863/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-hud.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5169922970543713863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5169922970543713863'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-hud.html' title='【AndEngine】TMX map を使った簡単な例 HUDを使う'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6P7lj_zzLD8qqsy9ucQ6pKHsxumlvM72qk89Dyw9ykBRx67DTAkyx2O9WiGIXwgy2yY6vB9fvoOMKhQHeZ_zOHc5pqSO7-5_2yR1VBrQWkS04KEpjygKriaLoB4S3MjA7vdh_RXjdanY/s72-c/screenshot_2012-01-13_0005.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-5624263927181956786</id><published>2012-01-12T00:56:00.002+09:00</published><updated>2012-01-12T00:59:19.893+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例 プレイヤーを移動させる（AStarPath編）</title><content type='html'>&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map-path_10.html&quot; target=&quot;_blank&quot;&gt;前回&lt;/a&gt;はプレイヤーの移動する座標をpathに登録しましたが、今回は２点間の最短経路をpathに登録してプレイヤーを移動させる方法についてです。&lt;br /&gt;
タワーディフェンス系のゲームで敵がゴールに向かって最短経路で進んだりするやつです。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AStarPathFinderクラスのfindPathメソッドで最短経路のPathを取得できます。&lt;br /&gt;
ただしfindPathメソッドで定義したApathはタイルの列と行なので座標に変換する必要があります。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;/AStarPathを定義
final org.anddev.andengine.util.path.Path Apath;
// findpath（）の動作を定義
final ITiledMap&amp;lt;TMXLayer&amp;gt; tmap = new ITiledMap&amp;lt;TMXLayer&amp;gt;(){

  public int getTileColumns() {
    return mTMXTiledMap.getTileColumns();
  }

  public int getTileRows() {
     return mTMXTiledMap.getTileRows();
  }

  // findpath()で処理されるときに処理する必要があるコードはここに記述
  public void onTileVisitedByPathFinder(int pTileColumn, int pTileRow) {
  }

   // どのブロックをブロックしたいかカスタマイズできる
   Lets you customize what blocks you want to be considered blocked
  public boolean isTileBlocked(TMXLayer pEntity, int pTileColumn, int pTileRow) {
    // false by defaultの場合はブロックは無し
        return false;
  }

  // 重要
  // pathの次のタイルのコストを返却
  public float getStepCost(TMXLayer pEntity, int pFromTileColumn, int pFromTileRow, int pToTileColumn, int pToTileRow) {
    // ↓例
    TMXProperty cost = tmxLayer.getTMXTile(pToTileColumn, pToTileRow).getTMXTileProperties(mTMXTiledMap).get(0);
    return Float.parseFloat(cost.getValue());
  }

};

// AStarPathFinderを宣言
// 第１引数：上記のITiledMap
// 第２引数：最大検索の深さ（この値が小さすぎる場合、プログラムがクラッシュします。）
// 第３引数：斜め移動を許可するかどうか
// 第４引数：（オプション）ヒューリスティック関数の使用
AStarPathFinder&amp;lt;TMXLayer&amp;gt; AStarPath = new AStarPathFinder&amp;lt;TMXLayer&amp;gt;(tmap, 100, false);

// findPath()でpathを作成
// 第１引数：TMXLayerの場合、上記ITiledMapとAStarPathFinder関数を使ってテンプレート化。
// 第２引数：最大のコスト（１タイルではなく終了までの値。値が小さすぎる場合、プログラムがクラッシュします。）
// 第３引数＆第４引数：スタートタイルの場所（列と行で指定）
// 第５引数＆第６引数：エンドタイルの場所（列と行で指定）
Apath = AStarPath.findPath(this.mTMXTiledMap.getTMXLayers().get(0), 100, 1, 13, 5, 12);

// プレイヤーのエンドタイルの場所をセットしておく
final TMXTile tmxTile = tmxLayer.getTMXTile(5, 12);
if(tmxTile != null) {
  player.setPosition(tmxTile.getTileX(), tmxTile.getTileY());
}

// 実際にスプライトを操作するための座標ベースのパスを宣言
final Path path = new Path(Apath.getLength());

int tilewidth = mTMXTiledMap.getTileWidth();
int tileheight = mTMXTiledMap.getTileHeight();

// 座標ベースのパスからAStarPath用に変換
for(int i=0;i &amp;lt; Apath.getLength();i++)
{
  path.to((Apath.getTileColumn(i) * tilewidth), (Apath.getTileRow(i) * tileheight));
}

// スプライトの移動時間をそれぞれのタイルで0.5になるように設定
// Move the sprite, the duration in PathModifier sets each tile to a .5 duration
player.registerEntityModifier(new PathModifier((Apath.getLength()/2), path, null, new IPathModifierListener() {
  public void onPathStarted(PathModifier pPathModifier, IEntity pEntity) {
  }

  public void onPathWaypointStarted(PathModifier pPathModifier, IEntity pEntity, int pWaypointIndex) {
  }

  public void onPathWaypointFinished(PathModifier pPathModifier, IEntity pEntity, int pWaypointIndex) {
  }

  public void onPathFinished(PathModifier pPathModifier, IEntity pEntity) {
  }
}));

&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/util/path/Path.html&quot; target=&quot;_blank&quot;&gt;Class Path&lt;/a&gt;(org.anddev.andengine.util.path.Path)&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/util/path/astar/AStarPathFinder.html&quot; target=&quot;_blank&quot;&gt;Class AStarPathFinder&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/5624263927181956786/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-astarpath.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5624263927181956786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5624263927181956786'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-astarpath.html' title='【AndEngine】TMX map を使った簡単な例 プレイヤーを移動させる（AStarPath編）'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-7478518670356765744</id><published>2012-01-10T23:16:00.037+09:00</published><updated>2012-01-11T22:32:36.068+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例 プレイヤーを移動させる（Path編）</title><content type='html'>RPGなどで町の中の人などが決められたルートを歩いていたりする。&lt;br /&gt;
そういったことを実現するための方法。&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;変数等は前回までのコードか&lt;a href=&quot;http://www.andengine.org/forums/tutorials/collision-objects-from-tmx-map-t3907.html#p17923&quot; target=&quot;_blank&quot;&gt;参考元のソース&lt;/a&gt;を参考に&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;Pathを生成してルートを指定。&lt;/div&gt;&lt;div&gt;PathModifierを生成。&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;brush: java&quot;&gt;
final Path path = new Path(5).to(20, 20).to(0, 100).to(100, 100).to(100, 20).to(20, 20);
final PathModifier pathModifier = new PathModifier(10, path, null, new IPathModifierListener(){
  
  public void onPathStarted(PathModifier pPathModifier, IEntity pEntity) {
  }
  public void onPathWaypointStarted(PathModifier pPathModifier, IEntity pEntity, int pWaypointIndex) {
    //ここにプレイヤーのアニメーション等を記述
  }
  
  public void onPathWaypointFinished(PathModifier pPathModifier, IEntity pEntity, int pWaypointIndex) {
  }

  public void onPathFinished(PathModifier pPathModifier, IEntity pEntity) {
  }
});
  
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;player(&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/entity/sprite/AnimatedSprite.html&quot; target=&quot;_blank&quot;&gt;AnimatedSpriteクラス&lt;/a&gt;)にpathModifierを登録&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;
player.registerEntityModifier(pathModifier);

//Pathをループさせたい場合はLoopEntityModifierを挟む
//player.registerEntityModifier(new LoopEntityModifier(pathModifier));
  
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/entity/modifier/PathModifier.Path.html&quot; target=&quot;_blank&quot;&gt;Class PathModifier.Path&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/entity/modifier/PathModifier.html&quot; target=&quot;_blank&quot;&gt;Class PathModifier&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://codetheater.com/andengine_javadoc/org/anddev/andengine/entity/modifier/LoopEntityModifier.html&quot; target=&quot;_blank&quot;&gt;Class LoopEntityModifier&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/7478518670356765744/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-path_10.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/7478518670356765744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/7478518670356765744'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-path_10.html' title='【AndEngine】TMX map を使った簡単な例 プレイヤーを移動させる（Path編）'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-5220909410800550267</id><published>2012-01-09T13:26:00.000+09:00</published><updated>2012-01-09T13:26:47.788+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例 DigitalOnScreenControlでスプライトを移動</title><content type='html'>&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol.html&quot; target=&quot;_blank&quot;&gt;前回&lt;/a&gt;ではDigitalOnScreenControlでプレイヤーを操作するところまででした。&lt;br /&gt;
&lt;br /&gt;
今回はDigitalOnScreenControlでプレイヤーを移動することをします。&lt;br /&gt;
&lt;br /&gt;
概要&lt;br /&gt;
・physics worldを作成&lt;br /&gt;
・プレイヤーを物理シミュレーション上で動くようにBodyを作成&lt;br /&gt;
・DigitalOnScreenControlの操作でプレイヤーを動かす&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public Scene onLoadScene() {
&amp;nbsp; this.mEngine.registerUpdateHandler(new FPSLogger());

&amp;nbsp; // Create physics world
&amp;nbsp; this.mPhysicsWorld = new FixedStepPhysicsWorld(30, new Vector2(0, 0), false, 3, 2);

&amp;nbsp; //Create the scene and register the physics world
&amp;nbsp; mScene = new Scene();
&amp;nbsp; mScene.registerUpdateHandler(this.mPhysicsWorld);

&amp;nbsp; //TMX mapの読み込み
&amp;nbsp; try {
&amp;nbsp; &amp;nbsp; final TMXLoader tmxLoader = new TMXLoader(this, this.mEngine.getTextureManager(), // TextureOptions.BILINEAR_PREMULTIPLYALPHA,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextureOptions.NEAREST);
&amp;nbsp; &amp;nbsp; this.mTMXTiledMap = tmxLoader.loadFromAsset(this, &quot;tmx/ground1.tmx&quot;);
&amp;nbsp; } catch (final TMXLoadException tmxle) {
&amp;nbsp; &amp;nbsp; Debug.e(tmxle);
&amp;nbsp; }

&amp;nbsp; // レイヤーをSceneに結びつける
&amp;nbsp; for (int i = 0; i &amp;lt; this.mTMXTiledMap.getTMXLayers().size(); i++){
&amp;nbsp; &amp;nbsp; TMXLayer layer = this.mTMXTiledMap.getTMXLayers().get(i);
&amp;nbsp; &amp;nbsp; mScene.attachChild(layer);

&amp;nbsp; }

&amp;nbsp; // カメラがTMXLayerの境界を超えないようにする
&amp;nbsp; final TMXLayer tmxLayer = this.mTMXTiledMap.getTMXLayers().get(0);
&amp;nbsp; this.mBoundChaseCamera.setBounds(0, tmxLayer.getWidth(), 0, tmxLayer.getHeight());
&amp;nbsp; this.mBoundChaseCamera.setBoundsEnabled(true);


&amp;nbsp; //プレイヤーの表示
&amp;nbsp; final int centerX = (CAMERA_WIDTH - this.mPlayerTextureRegion.getTileWidth()) / 2;
&amp;nbsp; final int centerY = (CAMERA_HEIGHT - this.mPlayerTextureRegion.getTileHeight()) / 2;

&amp;nbsp; final AnimatedSprite player = new AnimatedSprite(centerX, centerY, this.mPlayerTextureRegion);
&amp;nbsp; this.mBoundChaseCamera.setChaseEntity(player);
&amp;nbsp; final FixtureDef playerFixtureDef = PhysicsFactory.createFixtureDef(0, 0, 0.5f);
&amp;nbsp; final Body mPlayerBody = PhysicsFactory.createBoxBody(this.mPhysicsWorld, player,
&amp;nbsp; &amp;nbsp; &amp;nbsp; BodyType.DynamicBody, playerFixtureDef);
&amp;nbsp; this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(player,
&amp;nbsp; &amp;nbsp; &amp;nbsp; mPlayerBody, true, false){
&amp;nbsp; &amp;nbsp; @Override
&amp;nbsp; &amp;nbsp; public void onUpdate(float pSecondsElapsed){
&amp;nbsp; &amp;nbsp; &amp;nbsp; super.onUpdate(pSecondsElapsed);
&amp;nbsp; &amp;nbsp; &amp;nbsp; mBoundChaseCamera.updateChaseEntity();
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; });
&amp;nbsp; mScene.attachChild(player);

&amp;nbsp; //プレイヤーのコントロール
&amp;nbsp; this.mDigitalOnScreenControl = new DigitalOnScreenControl(0,
&amp;nbsp; &amp;nbsp; &amp;nbsp; CAMERA_HEIGHT - this.mOnScreenControlBaseTextureRegion.getHeight(),
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mBoundChaseCamera,
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mOnScreenControlBaseTextureRegion,
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mOnScreenControlKnobTextureRegion, 0.1f,
&amp;nbsp; &amp;nbsp; &amp;nbsp; new IOnScreenControlListener() {
&amp;nbsp; &amp;nbsp; public void onControlChange(final BaseOnScreenControl pBaseOnScreenControl,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final float pValueX, final float pValueY) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; // Set the correct walking animation
&amp;nbsp; &amp;nbsp; &amp;nbsp; if (pValueY == 1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Up
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.UP){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 0, 2, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.UP;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }else if (pValueY == -1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Down
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.DOWN){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 9, 11, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.DOWN;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }else if (pValueX == -1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Left
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.LEFT){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 3, 5, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.LEFT;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }else if (pValueX == 1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Right
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.RIGHT){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 6, 8, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.RIGHT;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }else{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (player.isAnimationRunning()){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.stopAnimation();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.NONE;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; // Set the player&#39;s velocity
&amp;nbsp; &amp;nbsp; &amp;nbsp; mPlayerBody.setLinearVelocity(pValueX * PLAYER_VELOCITY, pValueY * PLAYER_VELOCITY);
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; });
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setBlendFunction(GL10.GL_SRC_ALPHA,
&amp;nbsp; &amp;nbsp; &amp;nbsp; GL10.GL_ONE_MINUS_SRC_ALPHA);
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setAlpha(0.5f);
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setScaleCenter(0, 128);
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setScale(1.25f);
&amp;nbsp; this.mDigitalOnScreenControl.getControlKnob().setScale(1.25f);
&amp;nbsp; this.mDigitalOnScreenControl.getControlKnob().setAlpha(0.5f);
&amp;nbsp; this.mDigitalOnScreenControl.refreshControlKnobPosition();

&amp;nbsp; mScene.setChildScene(this.mDigitalOnScreenControl);

&amp;nbsp; return mScene;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
解説&lt;br /&gt;
&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol.html&quot; target=&quot;_blank&quot;&gt;前回&lt;/a&gt;のコードに追記する形でonLoadScene()メソッド内のコードを載せています。&lt;br /&gt;
&lt;br /&gt;
5行目でphysics worldを作成しています。&lt;br /&gt;
これを9行目でSceneに対UpdateHandlerとして登録しています。&lt;br /&gt;
&lt;br /&gt;
physics worldについては以下を参考にしてください。&lt;br /&gt;
&lt;a href=&quot;http://wiki.andengine.org/AndEnginePhysicsBox2DExtension#Creating_a_Physicsworld&quot; target=&quot;_blank&quot;&gt;AndEnginePhysicsBox2DExtension::Creating A Physicsworld&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
38から49行目でBodyを作成しています。&lt;br /&gt;
&lt;br /&gt;
93行目でBodyに対して速度を設定しています。&lt;br /&gt;
&lt;br /&gt;
以上でプレイヤーはDigitalOnScreenControlの操作で移動することができます。&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/5220909410800550267/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol_09.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5220909410800550267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/5220909410800550267'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol_09.html' title='【AndEngine】TMX map を使った簡単な例 DigitalOnScreenControlでスプライトを移動'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-8040081990027437375</id><published>2012-01-07T14:13:00.002+09:00</published><updated>2012-01-09T13:29:05.621+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例 スプライトとDigitalOnScreenControl</title><content type='html'>&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map.html&quot; target=&quot;_blank&quot;&gt;前回の続き&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
今回の内容&lt;br /&gt;
・TMX mapにプレイヤーのスプライトを表示&lt;br /&gt;
・プレイヤーをDigitalOnScreenControlで操作できるようにする。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
概要&lt;br /&gt;
onLoadResources()&lt;br /&gt;
・スプライトのテクスチャ読み込み&lt;br /&gt;
・DigitalOnScreenControlのテクスチャを読み込み&lt;br /&gt;
(画像については前回同様、TileCollision.zipに含まれている画像を使用)&lt;br /&gt;
&lt;br /&gt;
onLoadScene()&lt;br /&gt;
・プレイヤーを表示&lt;br /&gt;
・DigitalOnScreenControlでプレイヤーを操作&lt;br /&gt;
&lt;br /&gt;
クラス変数にenumを定義。その他必要な物は元のソースを参考に追加&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;private enum PlayerDirection{
&amp;nbsp; NONE,
&amp;nbsp; UP,
&amp;nbsp; DOWN,
&amp;nbsp; LEFT,
&amp;nbsp; RIGHT
}
private PlayerDirection playerDirection = PlayerDirection.NONE;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
onLoadResources()&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public void onLoadResources() {
&amp;nbsp; BitmapTextureAtlasTextureRegionFactory.setAssetBasePath(&quot;gfx/&quot;); // assets/gfx配下に画像が置かれていること
&amp;nbsp; // Control texture
&amp;nbsp; this.mOnScreenControlTexture = new BitmapTextureAtlas(256, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
&amp;nbsp; this.mOnScreenControlBaseTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, this, &quot;onscreen_control_base.png&quot;, 0, 0);
&amp;nbsp; this.mOnScreenControlKnobTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, this, &quot;onscreen_control_knob.png&quot;, 128, 0);

&amp;nbsp; // Player sprite texture
&amp;nbsp; this.mTexturePlayer = new BitmapTextureAtlas(128, 128, TextureOptions.DEFAULT);
&amp;nbsp; this.mPlayerTextureRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.mTexturePlayer, this, &quot;hero.png&quot;, 0, 0, 3, 4);

&amp;nbsp; // Load the textures
&amp;nbsp; this.mEngine.getTextureManager().loadTextures(this.mTexturePlayer, this.mOnScreenControlTexture);
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
onLoadScene()&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public Scene onLoadScene() {

&amp;nbsp; /*・・省略(TMX mapの読み込み等)・・*/
&amp;nbsp;
&amp;nbsp; //プレイヤーのアニメーションをインスタンス化
&amp;nbsp; final int centerX = (CAMERA_WIDTH - this.mPlayerTextureRegion.getTileWidth()) / 2;
&amp;nbsp; final int centerY = (CAMERA_HEIGHT - this.mPlayerTextureRegion.getTileHeight()) / 2;
&amp;nbsp; final AnimatedSprite player = new AnimatedSprite(centerX, centerY, this.mPlayerTextureRegion);
&amp;nbsp;
&amp;nbsp; //Sceneにプレイヤーを結びつける
&amp;nbsp; mScene.attachChild(player);
&amp;nbsp;
&amp;nbsp; //プレイヤーのコントロール
&amp;nbsp; this.mDigitalOnScreenControl = new DigitalOnScreenControl(0,
&amp;nbsp; &amp;nbsp; &amp;nbsp; CAMERA_HEIGHT - this.mOnScreenControlBaseTextureRegion.getHeight(),
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mBoundChaseCamera,
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mOnScreenControlBaseTextureRegion,
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mOnScreenControlKnobTextureRegion, 0.1f,
&amp;nbsp; &amp;nbsp; &amp;nbsp; new IOnScreenControlListener() {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onControlChange(final BaseOnScreenControl pBaseOnScreenControl, final float pValueX, final float pValueY) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Set the correct walking animation
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (pValueY == 1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Up
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.UP){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 0, 2, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.UP;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }else if (pValueY == -1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Down
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.DOWN){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 9, 11, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.DOWN;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }else if (pValueX == -1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Left
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.LEFT){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 3, 5, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.LEFT;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }else if (pValueX == 1){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Right
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (playerDirection != PlayerDirection.RIGHT){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.animate(ANIMATE_DURATION, 6, 8, true);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.RIGHT;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }else{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (player.isAnimationRunning()){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; player.stopAnimation();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; playerDirection = PlayerDirection.NONE;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; });
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setAlpha(0.5f);
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setScaleCenter(0, 128);
&amp;nbsp; this.mDigitalOnScreenControl.getControlBase().setScale(1.25f);
&amp;nbsp; this.mDigitalOnScreenControl.getControlKnob().setScale(1.25f);
&amp;nbsp; this.mDigitalOnScreenControl.getControlKnob().setAlpha(0.5f);
&amp;nbsp; this.mDigitalOnScreenControl.refreshControlKnobPosition();
&amp;nbsp; //Sceneの
&amp;nbsp; mScene.setChildScene(this.mDigitalOnScreenControl);

&amp;nbsp; return mScene;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
実行するとこうなります。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrg9v_e4xXWbIz1h-UDoshkQx3bfrDKXOLdg34WhKKIZ36rGeQLApNJU2b3bojEI7XIKwqk8GdQQJzunkgQwDNq6Nf-6-F7OatuDO0xxoX8VdB7oBkIbewzYzdrBZuB6UDb5fSyhK-TgM/s1600/screenshot_2012-01-07_1402.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrg9v_e4xXWbIz1h-UDoshkQx3bfrDKXOLdg34WhKKIZ36rGeQLApNJU2b3bojEI7XIKwqk8GdQQJzunkgQwDNq6Nf-6-F7OatuDO0xxoX8VdB7oBkIbewzYzdrBZuB6UDb5fSyhK-TgM/s320/screenshot_2012-01-07_1402.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
今回の内容ではプレイヤーの向きが変わるだけです。&lt;br /&gt;
&lt;a href=&quot;http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol_09.html&quot; target=&quot;_blank&quot;&gt;次回&lt;/a&gt;ではプレイヤーが移動するようにします。&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/8040081990027437375/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/8040081990027437375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/8040081990027437375'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map-digitalonscreencontrol.html' title='【AndEngine】TMX map を使った簡単な例 スプライトとDigitalOnScreenControl'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrg9v_e4xXWbIz1h-UDoshkQx3bfrDKXOLdg34WhKKIZ36rGeQLApNJU2b3bojEI7XIKwqk8GdQQJzunkgQwDNq6Nf-6-F7OatuDO0xxoX8VdB7oBkIbewzYzdrBZuB6UDb5fSyhK-TgM/s72-c/screenshot_2012-01-07_1402.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-1647273646632084599</id><published>2012-01-06T12:59:00.001+09:00</published><updated>2012-01-06T13:03:50.930+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AndEngine"/><title type='text'>【AndEngine】TMX map を使った簡単な例</title><content type='html'>ここのサンプルを参考にした。&lt;br /&gt;
&lt;a href=&quot;http://www.andengine.org/forums/tutorials/collision-objects-from-tmx-map-t3907.html#p17923&quot; target=&quot;_blank&quot;&gt;[Tutorial] Collision objects from TMX map&lt;/a&gt;&lt;br /&gt;
リンク先のTileCollision.zipをダウンロードしてTileの画像等を利用しました。&lt;br /&gt;
&lt;br /&gt;
事前に以下のことをする。&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;andengine.jarをライブラリに追加&lt;/li&gt;
&lt;li&gt;タイルの画像を用意&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.mapeditor.org/&quot; target=&quot;_blank&quot;&gt;Tiled&lt;/a&gt;を使ってtmxファイルを用意&lt;/li&gt;
&lt;/ul&gt;では、TileCollisionを参考にTMX mapの表示をする。&lt;br /&gt;
ここでは単にTMX mapを表示するまでの最小限のコードとする。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class WtMiniTestActivity extends BaseGameActivity {

&amp;nbsp; static final int CAMERA_WIDTH = 480;
&amp;nbsp; static final int CAMERA_HEIGHT = 320;

&amp;nbsp; private TMXTiledMap mTMXTiledMap;
&amp;nbsp; private BoundCamera mBoundChaseCamera;

&amp;nbsp; //Scene
&amp;nbsp; private Scene mScene;

&amp;nbsp; public Engine onLoadEngine() {
&amp;nbsp; &amp;nbsp; this.mBoundChaseCamera = new BoundCamera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
&amp;nbsp; &amp;nbsp; return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT),
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.mBoundChaseCamera));
&amp;nbsp; }

&amp;nbsp; public void onLoadResources() {
&amp;nbsp; }

&amp;nbsp; public Scene onLoadScene() {
&amp;nbsp; &amp;nbsp; this.mEngine.registerUpdateHandler(new FPSLogger());

&amp;nbsp; &amp;nbsp; mScene = new Scene();
&amp;nbsp; &amp;nbsp; //TMX mapの読み込み
&amp;nbsp; &amp;nbsp; try {
&amp;nbsp; &amp;nbsp; &amp;nbsp; final TMXLoader tmxLoader = new TMXLoader(this,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.mEngine.getTextureManager(), // TextureOptions.BILINEAR_PREMULTIPLYALPHA,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextureOptions.NEAREST);
&amp;nbsp; &amp;nbsp; &amp;nbsp; this.mTMXTiledMap = tmxLoader.loadFromAsset(this, &quot;tmx/ground1.tmx&quot;);
&amp;nbsp; &amp;nbsp; } catch (final TMXLoadException tmxle) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; Debug.e(tmxle);
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; // レイヤーをSceneに結びつける
&amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; this.mTMXTiledMap.getTMXLayers().size(); i++){
&amp;nbsp; &amp;nbsp; &amp;nbsp; TMXLayer layer = this.mTMXTiledMap.getTMXLayers().get(i);
&amp;nbsp; &amp;nbsp; &amp;nbsp; mScene.attachChild(layer);
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; // カメラがTMXLayerの境界を超えないようにする
&amp;nbsp; &amp;nbsp; final TMXLayer tmxLayer = this.mTMXTiledMap.getTMXLayers().get(0);
&amp;nbsp; &amp;nbsp; this.mBoundChaseCamera.setBounds(0, tmxLayer.getWidth(), 0,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tmxLayer.getHeight());
&amp;nbsp; &amp;nbsp; this.mBoundChaseCamera.setBoundsEnabled(true);

&amp;nbsp; &amp;nbsp; return mScene;
&amp;nbsp; }

&amp;nbsp; public void onLoadComplete() {
&amp;nbsp; }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
上記のコードで表示されるのが以下の様な感じ&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMTNaCoFlDok28Y7RqTX7S82G-sj-O0dn3604RzeYP8VrFU0jN1VOUSqPoQjUc3vaDyt8494uSET4hw2bO_KPg-uBp9oQwy9gQ19ZN6pbsSh77OPHjUa3oIFZi5FfrHg2749apT5TV_Uk/s1600/screenshot_2012-01-06_1228.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMTNaCoFlDok28Y7RqTX7S82G-sj-O0dn3604RzeYP8VrFU0jN1VOUSqPoQjUc3vaDyt8494uSET4hw2bO_KPg-uBp9oQwy9gQ19ZN6pbsSh77OPHjUa3oIFZi5FfrHg2749apT5TV_Uk/s320/screenshot_2012-01-06_1228.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
今日はここまで。</content><link rel='replies' type='application/atom+xml' href='http://nasu-production.blogspot.com/feeds/1647273646632084599/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/1647273646632084599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/1647273646632084599'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/andenginetmx-map.html' title='【AndEngine】TMX map を使った簡単な例'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMTNaCoFlDok28Y7RqTX7S82G-sj-O0dn3604RzeYP8VrFU0jN1VOUSqPoQjUc3vaDyt8494uSET4hw2bO_KPg-uBp9oQwy9gQ19ZN6pbsSh77OPHjUa3oIFZi5FfrHg2749apT5TV_Uk/s72-c/screenshot_2012-01-06_1228.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8619149015462818880.post-713672406852041853</id><published>2012-01-05T09:33:00.000+09:00</published><updated>2012-01-05T09:33:28.644+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="雑記"/><title type='text'>【雑記】SyntaxHighlighterを使う</title><content type='html'>ソースコードの表示テスト&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;
public class HelloWorld{
&amp;nbsp; &amp;nbsp; public static void main(String [] args) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Hello world!&quot;);
&amp;nbsp; &amp;nbsp; }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
コードを投稿する際に以下の内容を記述&lt;br /&gt;
ex.)java&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: html&quot;&gt;

&lt;pre class=&quot;brush: java&quot;&gt;

&amp;nbsp;投稿のコード
&lt;/pre&gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
参考させていただいたサイト&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://moririn-web.blogspot.com/2011/12/bloggersyntaxhighlighter-ver3x.html&quot; target=&quot;_blank&quot;&gt;BloggerにおけるSyntaxHighlighter Ver.3.x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://syntaxhighlighter.dohow.jp/index.shtml&quot; target=&quot;_blank&quot;&gt;Syntax Highlighter とは？&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/713672406852041853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8619149015462818880/posts/default/713672406852041853'/><link rel='alternate' type='text/html' href='http://nasu-production.blogspot.com/2012/01/syntaxhighlighter.html' title='【雑記】SyntaxHighlighterを使う'/><author><name>nasu</name><uri>http://www.blogger.com/profile/18195057464362401935</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfK1KwStKY7QvWg0ihNFOb1Z_-QvVm8DKFjKchjKaEPSLVZ7L7_-ifxWBd0nscou6SKCHi3h3rbdyLbEoSYoptbMMOwTC0yAr4dpAhIpVEecHyEQIa7MXK49wUqU_YJI/s220/ROBA.png'/></author></entry></feed>