{"id":8684,"date":"2017-10-19T21:15:21","date_gmt":"2017-10-19T12:15:21","guid":{"rendered":"http:\/\/leavebehind.iobb.net\/wordpress\/?p=8684"},"modified":"2018-07-28T16:15:27","modified_gmt":"2018-07-28T07:15:27","slug":"p5-js-on-electron","status":"publish","type":"post","link":"http:\/\/leavebehind.mydns.jp\/wordpress\/2017\/10\/19\/p5-js-on-electron\/","title":{"rendered":"p5.js on Electron"},"content":{"rendered":"<p>ActionScript\u306e\u4ee3\u66ff\u3068\u3057\u3066<a href=\"https:\/\/electron.atom.io\/\">Electron<\/a>\u306e\u52c9\u5f37\u3092\u3068\u8a00\u3044\u3064\u3064\u3001\u4ed5\u4e8b\u304c\u5fd9\u3057\u304f\u306a\u308a\u5168\u304f\u624b\u3092\u4ed8\u3051\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u3061\u3087\u3063\u3068\u518d\u958b\u3002<\/p>\n<p>\u306a\u306b\u305b\u300c<a href=\"https:\/\/www.amazon.co.jp\/dp\/4774188190\">Electron\u3067\u306f\u3058\u3081\u308b\u30a2\u30d7\u30ea\u958b\u767a<\/a>[Amazon.co.jp]\u300d\u306e\u6577\u5c45\u304c\u9ad8\u3044\uff01\u7b2c3\u7ae0\u306e\u300c\u30c1\u30e3\u30c3\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308d\u3046\u300d\u304b\u3089ES6(ES2015)\u306eJavascript\u3067\u66f8\u304d\u59cb\u3081\u3066\u3001\u300cimport?\u300d\u3055\u3063\u304d\u307e\u3067\u306e\u300crequire\u300d\u306f\u3069\u3053\u3044\u3063\u305f\u306e\uff1f\u304b\u3089\u306eReact\u306e\u6d45\u30fc\u3044\u8aac\u660e\u3068\u3001Web\u30a2\u30d7\u30ea\u306e\u958b\u767a\u7d4c\u9a13\u304c\u7121\u3044\u3068\u8aad\u307f\u9032\u3081\u308b\u306e\u306f\u96e3\u3057\u3044\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<p>\u3066\u306a\u3053\u3068\u3067\u3001\u6a2a\u9053\u306b\u305d\u308c\u3066(\u9003\u3052\u3066?)\u300cElectron\u4e0a\u3067Processing\u3092\u52d5\u304b\u3057\u3066\u307f\u308b\u300d\u3067\u3059\u3002<\/p>\n<p>\u6b63\u78ba\u306b\u306f\u305d\u306eJavascript\u5b9f\u88c5\u7248\u306e\u300c<a href=\"https:\/\/p5js.org\/\">p5.js<\/a>\u300d\u3092\u52d5\u304b\u3057\u3066\u307f\u305f\uff01\u3067\u3059\u3002<\/p>\n<figure id=\"attachment_8687\" aria-describedby=\"caption-attachment-8687\" style=\"width: 750px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/leavebehind.iobb.net\/wordpress\/wp-content\/uploads\/2017\/10\/p5js_on_electron.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8687 size-large\" src=\"http:\/\/leavebehind.iobb.net\/wordpress\/wp-content\/uploads\/2017\/10\/p5js_on_electron-1024x733.jpg\" alt=\"\" width=\"750\" height=\"537\" srcset=\"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-content\/uploads\/2017\/10\/p5js_on_electron-1024x733.jpg 1024w, http:\/\/leavebehind.mydns.jp\/wordpress\/wp-content\/uploads\/2017\/10\/p5js_on_electron-300x215.jpg 300w, http:\/\/leavebehind.mydns.jp\/wordpress\/wp-content\/uploads\/2017\/10\/p5js_on_electron-768x550.jpg 768w, http:\/\/leavebehind.mydns.jp\/wordpress\/wp-content\/uploads\/2017\/10\/p5js_on_electron.jpg 1322w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><figcaption id=\"caption-attachment-8687\" class=\"wp-caption-text\">Processing-Java\u3088\u308a\u304b\u306a\u308a\u91cd\u3044<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u3044\u307e\u307e\u3067\u4f5c\u3063\u3066\u304d\u305fProcessing\u306e\u30b9\u30b1\u30c3\u30c1\u306b\u306f\u8ffd\u52a0\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u306a\u3082\u306e\u3070\u304b\u308a\u3067\u3057\u305f\u306e\u3067\u4f7f\u7528\u305b\u305a\u3001<a href=\"https:\/\/p5js.org\/examples\/simulate-flocking.html\">p5js.org\u306eFlocking<\/a>\u3092\u79fb\u690d\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u79fb\u690d\u3068\u8a00\u3063\u3066\u3082\u3001<a href=\"https:\/\/github.com\/processing\/p5.js\/wiki\/Instantiation-Cases\">p5\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e2\u30fc\u30c9\u3067\u52d5\u304b\u3059<\/a>\u4e8b\u3068Flock\u3068Boid\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3057\u305f\u3063\u3066\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3068\u8aad\u8fbc\u306fnode.js\u306erequire\u3067\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002ES2016\u306a\u3089import\u3084class\u304c\u4f7f\u3048\u308b\u306e\u3067\u66f8\u304d\u3084\u3059\u3044\u3093\u3067\u3059\u304c\u3001\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u3092\u631f\u3080\u4e8b\u306b\u306a\u308ap5\u304c\u52d5\u304b\u306a\u3044\u6642\u306b\u554f\u984c\u306e\u5207\u308a\u5206\u3051\u304c\u4eca\u306f\u4e0a\u624b\u304f\u3067\u304d\u305d\u3046\u306b\u306a\u3044\u306e\u3067\u5f8c\u56de\u3057\u3067\u3059\u3002\u4eca\u56de\u66f8\u3044\u305f\u306e\u306fNode Integration\u306aJavascript\u3068\u3044\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u3065\u3044\u305f\u6240\u304c\u4f55\u70b9\u304b\u3001<\/p>\n<p>\u3044\u304d\u306a\u308aElectrom\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30bd\u30d5\u30c8\u306e\u300cESET Endpoint Antivirus\u300d\u304c\u90aa\u9b54\u3092\u3057\u3066\u3044\u305f\u3089\u3057\u304f\u4e00\u6642\u7684\u306b\u30aa\u30d5\u306b\u3059\u308b\u4e8b\u3067\u300cnpm install\u300d\u3092\u901a\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3042\u3068\u3001\u6307\u5b9a\u30b5\u30a4\u30ba\u3074\u3063\u305f\u308a\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30a4\u30ba\u3092\u7528\u610f\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001<\/p>\n<pre class=\"lang:js decode:true \">win = new BrowserWindow({\"width\":800,\"height\":600,\"resizable\": false});<\/pre>\n<p>\u3068\u3059\u308b\u3060\u3051\u3067\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u30bf\u30a4\u30c8\u30eb\u3084\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u67a0\u3001\u3044\u308f\u3086\u308b\u30af\u30ed\u30fc\u30e0\u3082\u542b\u3081\u305f\u30b5\u30a4\u30ba\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true\">win = new BrowserWindow({\"width\":800,\"height\":600,\"resizable\": false,\"useContentSize\": true});<\/pre>\n<p>\u3068\u3059\u308b\u3053\u3068\u3067\u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30a4\u30ba\u304c800&#215;600\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u3063\u3066\u304f\u308c\u308b\u306e\u3067\u3059\u304c\u3001Windows\u3067\u5b9f\u884c\u3059\u308b\u5834\u5408\u306b\u51fa\u308b\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u3092\u6d88\u3057\u305f\u3044\u5834\u5408\u3001<\/p>\n<pre class=\"lang:js decode:true\">win = new BrowserWindow({\"width\":800,\"height\":600,\"resizable\": false,\"useContentSize\": true});\nwin.setMenu(null);<\/pre>\n<p>\u3068\u3059\u308b\u3068\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u306e\u9ad8\u3055\u5206\u9699\u9593\u304c\u51fa\u6765\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u308b\u524d\u306b\u30e1\u30cb\u30e5\u30fc\u3092\u6d88\u3059\u3053\u3068\u3067\u5bfe\u51e6\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:js decode:true\">Menu.setApplicationMenu(null);\nwin = new BrowserWindow({\"width\":800,\"height\":600,\"resizable\": false,\"useContentSize\": true});<\/pre>\n<p>\u8907\u6570\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u6301\u3063\u305f\u30a2\u30d7\u30ea\u306e\u5834\u5408\u306f\u554f\u984c\u304c\u51fa\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4eca\u56de\u306e\u6210\u679c\u7269\uff5e<a href=\"http:\/\/leavebehind.iobb.net\/wordpress\/wp-content\/uploads\/2017\/10\/electron_test_p5.zip\">electron_test_p5<\/a>\u3002<\/p>\n<p>\u5c55\u958b\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u3078\u30b7\u30a7\u30eb\u3067\u79fb\u52d5\u3057\u3066\u3001<span class=\"lang:sh decode:true crayon-inline\">$ npm install<\/span>\u00a0\u3067\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001<span class=\"lang:sh decode:true crayon-inline \">$ npm run start<\/span>\u00a0\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u9053\u306e\u308a\u9577\u3044\u306a\u30fc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ActionScript\u306e\u4ee3\u66ff\u3068\u3057\u3066Electron\u306e\u52c9\u5f37\u3092\u3068\u8a00\u3044\u3064\u3064\u3001\u4ed5\u4e8b\u304c\u5fd9\u3057\u304f\u306a\u308a\u5168\u304f\u624b\u3092\u4ed8\u3051\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u3061\u3087\u3063\u3068\u518d\u958b\u3002 \u306a\u306b\u305b\u300cElectron\u3067\u306f\u3058\u3081\u308b\u30a2\u30d7\u30ea\u958b\u767a[Amazon.co.jp]\u300d\u306e\u6577\u5c45\u304c\u9ad8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Electron\u4e0a\u3067p5.js\u3092\u52d5\u304b\u3057\u3066\u307f\u305f\u3002","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[321],"tags":[319,152,226],"class_list":["post-8684","post","type-post","status-publish","format-standard","hentry","category-development","tag-electron","tag-javascript","tag-processing"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p8YSE4-2g4","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/posts\/8684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=8684"}],"version-history":[{"count":10,"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/posts\/8684\/revisions"}],"predecessor-version":[{"id":8696,"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/posts\/8684\/revisions\/8696"}],"wp:attachment":[{"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=8684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=8684"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/leavebehind.mydns.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=8684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}