{"id":2731,"date":"2015-06-05T16:25:50","date_gmt":"2015-06-05T07:25:50","guid":{"rendered":"http:\/\/oohito.com\/nqthm\/?p=2731"},"modified":"2015-06-05T16:25:50","modified_gmt":"2015-06-05T07:25:50","slug":"%e3%81%af%e3%81%98%e3%82%81%e3%81%a6%e3%81%aemorphic%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab%ef%bc%88%e7%ac%ac%ef%bc%91%ef%bc%92%e5%9b%9e%ef%bc%89%e3%80%8c%e7%94%bb%e5%83%8f","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/2731","title":{"rendered":"\u306f\u3058\u3081\u3066\u306eMorphic\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\uff08\u7b2c\uff11\uff12\u56de\uff09\u300c\u753b\u50cf\u306e\u8868\u793a\u300d"},"content":{"rendered":"<p>\u4eca\u56de\u306f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30e2\u30fc\u30d5\u306b\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u3076\u3002<br \/>\n<a href=\"http:\/\/oohito.com\/nqthm\/archives\/2720\">\u306f\u3058\u3081\u3066\u306eMorphic\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\uff08\u756a\u5916\u7de8\uff09\u300cScratchCat\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u300d<\/a>\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fScratch Cat\u3092\u30e2\u30fc\u30d5\u306e\u8868\u9762\u306b\u8868\u793a\u3055\u305b\u308b\u3002<a href=\"http:\/\/wiki.scratch.mit.edu\/wiki\/Scratch_Media\">Scratch\u306e\u30e1\u30c7\u30a3\u30a2\u30b5\u30a4\u30c8<\/a>\u304b\u3089\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304a\u3044\u3066\u3082\u3088\u3044\u3002\u3044\u305a\u308c\u306b\u305b\u3088\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u5c55\u958b\u3055\u308c\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304c\u9069\u5f53\u306a\u30d5\u30a9\u30eb\u30c0\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u524d\u63d0\u3067\u8a71\u3092\u9032\u3081\u308b\u3002<br \/>\n\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u305f\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067Form\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308a\u3001\u305d\u308c\u3092\u8868\u793a\u3059\u308b\u3068\u3044\u3046\u6d41\u308c\u3067\u51e6\u7406\u3092\u884c\u3046\u3002<br \/>\n\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3002\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u30d5\u30eb\u30d1\u30b9\u3067\u6307\u5b9a\u3057\u3066\u3082\u3088\u3044\uff09<\/p>\n<pre>f1 := PNGReadWriter formFromFileNamed: 'Cat_1_Bitmap.png'.<\/pre>\n<p>PNGReadWriter\u306fPNG\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u305f\u3081\u306e\u30af\u30e9\u30b9\u3067\u3042\u308b\u3002\u4ed6\u306b\u3082BMPReadWriter\u3084GIFReadWriter\u3001AnimatedGIFReadWriter\u3001JPEGReadWriter\u304c\u3042\u308b\u3002\u5404\u30af\u30e9\u30b9\u306b\u5bfe\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u5f15\u6570\u3092\u4ed8\u3051\u3066formFromFileNamed:\u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308c\u3070\u3001\u6307\u5b9a\u3057\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067Form\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3059\u308b\u3002<br \/>\n\u751f\u6210\u3057\u3066\u5f97\u3089\u308c\u305fForm\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u5927\u304d\u3055\u3084\u30d3\u30c3\u30c8\u6df1\u5ea6\u306a\u3069\u306e\u60c5\u5831\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre>f1 extent. \"(184@200)\"\nf1 depth. \"32\"<\/pre>\n<p>MyMorph\u3067\u8272\u306e\u3064\u3044\u305f\u56db\u89d2\u5f62\u306e\u5909\u308f\u308a\u306bScratch Cat\u3092\u8868\u793a\u3059\u308b\u306a\u3089\u3001\u4e8b\u524d\u306b\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3093\u3067\u304a\u3044\u3066\u30e2\u30fc\u30d5\u8868\u793a\u306e\u969b\u306b\u63cf\u753b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u305d\u306e\u305f\u3081\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u5f97\u305fForm\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001form\u3068\u3044\u3046\u540d\u524d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3067\u899a\u3048\u3066\u304a\u304f\u3053\u3068\u306b\u3059\u308b\u3002<br \/>\n\u65b0\u305f\u306a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001MyMorph\u306e\u30af\u30e9\u30b9\u5b9a\u7fa9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<pre>Morph subclass: #MyMorph\n    instanceVariableNames: 'vec form'\n    classVariableNames: ''\n    category: 'Hajimeteno Morphic Tutorial'<\/pre>\n<p>System Browser\u3067MyMorph\u30af\u30e9\u30b9\u3092\u5909\u66f4\u3057\u3066Accept\u3059\u308b\u304b\u3001\u9069\u5f53\u306a\u5834\u6240\u3067\u4e0a\u8a18\u3092Do it\u3059\u308b\u3002<br \/>\n\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306finitialize\u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u3067\uff08\u3064\u307e\u308a\u30e2\u30fc\u30d5\u751f\u6210\u6642\u306b\uff09\u8aad\u307f\u8fbc\u3080\u3053\u3068\u306b\u3059\u308b\u3002\u30e2\u30fc\u30d5\u751f\u6210\u306e\u305f\u3073\u306b\u540c\u3058\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306e\u306f\u52b9\u7387\u304c\u60aa\u3044\u304c\u3001\u3053\u3053\u3067\u306f\u5358\u7d14\u5316\u306e\u305f\u3081\u306b\u305d\u3046\u3059\u308b\u3002\u307e\u305f\u3001\u5143\u306eMyMorph\u306f16&#215;16\u30d4\u30af\u30bb\u30eb\u306e\u5927\u304d\u3055\u306a\u306e\u3067\u3001Scratch Cat\u3092\u8868\u793a\u3067\u304d\u306a\u3044\u3002\u305d\u3053\u3067\u3001\u30e2\u30fc\u30d5\u306e\u5927\u304d\u3055\u3092\u753b\u50cf\u306e\u5927\u304d\u3055\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002\u307e\u305f\u3001\u5c11\u3057\u65e9\u3081\u306b\u52d5\u4f5c\u3059\u308b\u3088\u304610\u30d4\u30af\u30bb\u30eb\u305a\u3064\u306e\u79fb\u52d5\u3068\u3057\u305f\u3002<\/p>\n<pre>initialize\n    super initialize.\n    vec := 10 @ 0.\n    form := PNGReadWriter formFromFileNamed: 'Cat_1_Bitmap.png'.\n    self extent: form extent<\/pre>\n<p>\u30e2\u30fc\u30d5\u306fdrawOn:\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u9001\u3089\u308c\u308b\u3068\u5f15\u6570\u306b\u4e0e\u3048\u3089\u308c\u305f\u30ad\u30e3\u30f3\u30d0\u30b9\u3078\u81ea\u5206\u81ea\u8eab\u3092\u63cf\u753b\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u73fe\u72b6\u3067\u306f\u30e2\u30fc\u30d5\u306e\u5927\u304d\u3055\u306e\u8272\u306e\u4ed8\u3044\u305f\u56db\u89d2\u5f62\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u3002\u305d\u3053\u3067\u3001\u8aad\u307f\u8fbc\u3093\u3060Form\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306adrawOn:\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u3002<\/p>\n<pre>drawOn: aCanvas\n    aCanvas drawImage: form at: self topLeft<\/pre>\n<p>drawImage:at:\u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\uff12\u3064\u306e\u5f15\u6570\u3092\u6301\u3061\u3001\u6700\u521d\u306b\u8868\u793a\u3055\u305b\u305f\u3044Form\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u6b21\u306b\u753b\u9762\u4e0a\u306e\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b\u3002<br \/>\n\u4ee5\u4e0a\u306e\u3088\u3046\u306a\u5909\u66f4\u3092\u52a0\u3048\u305f\u4e0a\u3067\u3001MyMorph new openInWorld\u3092Do it\u3057\u3066\u307f\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n<a href=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2015\/06\/Screen-Shot-2015-06-05-at-14.13.38-1-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2015\/06\/Screen-Shot-2015-06-05-at-14.13.38-1-300x274.png\" alt=\"Scratch Cat bug\" width=\"300\" height=\"274\" class=\"alignnone size-medium wp-image-2733\" \/><\/a><br \/>\n\u3054\u89a7\u306e\u901a\u308a\u3001Scratch Cat\u304c\u8868\u793a\u3055\u308c\u308b\u3082\u306e\u306e\u3001\u30e2\u30fc\u30d5\u304c\u52d5\u304f\u305f\u3073\u306b\u5206\u8eab\u304c\u6b8b\u3063\u3066\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3046\u3002\u3053\u306e\u3088\u3046\u306a\u73fe\u8c61\u306f\u3001\u4eca\u56de\u306e\u3088\u3046\u306b\u900f\u660e\u90e8\u5206\u3092\u542b\u3080\u753b\u50cf\u3092\u63cf\u753b\u3057\u305f\u308a\u3001\u5168\u3066\u306e\u8868\u793a\u7bc4\u56f2\u3092\u4f7f\u308f\u305a\u306b\u63cf\u753b\u3057\u305f\u30e2\u30fc\u30d5\u3092\u52d5\u304b\u3059\u969b\u306b\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u3002<br \/>\n\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u306b\u306f\u6570\u30ab\u6240\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u307e\u305a\u5fc5\u8981\u306a\u3053\u3068\u306f\u3001\u5148\u307b\u3069\u5b9f\u88c5\u3057\u305fdrawOn:\u3067\u3001drawImage:at:\u306e\u4ee3\u308f\u308a\u306btranslucentImage:at:\u3092\u7528\u3044\u3066\u3001\u900f\u660e\u90e8\u5206\u306e\u63cf\u753b\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u3067\u3042\u308b\u3002<\/p>\n<pre>drawOn: aCanvas\n    aCanvas translucentImage: form at: self topLeft<\/pre>\n<p>\u66f4\u306b\u30e2\u30fc\u30d5\u81ea\u8eab\u306e\u8272\u304c\u900f\u660e\u3067\u3042\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n<pre>initialize\n    super initialize.\n    vec := 10 @ 0.\n    self color: Color transparent.\n    form := PNGReadWriter formFromFileNamed: 'Cat_1_Bitmap.png'.\n    self extent: form extent<\/pre>\n<p>\u4e2d\u592e\u306e\u884c\u3067\u900f\u660e\u8272\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<br \/>\n\u901a\u5e38\u306f\u3053\u308c\u3060\u3051\u3067\u826f\u3044\u306e\u3060\u304c\u3001MyMorph\u3067\u306fstep\u306e\u305f\u3073\u306b\u8272\u3092\u5909\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u305f\u306e\u3067\u3001\u8272\u3092\u5909\u3048\u306a\u3044\u3088\u3046\u306bstep\u30e1\u30bd\u30c3\u30c9\u3092\u4fee\u6b63\u3059\u308b\u3002<\/p>\n<pre>step\n    self topLeft: (self topLeft + vec)<\/pre>\n<p>\u4ee5\u4e0a\u3067\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3002<br \/>\n\uff12\u679a\u306e\u753b\u50cf\u3092\u4ea4\u4e92\u306b\u8868\u793a\u3055\u305b\u308b\u306e\u306f\u4eca\u307e\u3067\u306e\u5ef6\u9577\u7dda\u4e0a\u3067\u3067\u304d\u308b\u306e\u3067\u6f14\u7fd2\u306b\u3057\u3066\u304a\u3053\u3046\u3002<br \/>\n\uff08\u7b2c\uff11\uff12\u56de\u304a\u308f\u308a\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30e2\u30fc\u30d5\u306b\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u3076\u3002 \u306f\u3058\u3081\u3066\u306eMorphic\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\uff08\u756a\u5916\u7de8\uff09\u300cScratchCat\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u300d\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fScratch Cat\u3092\u30e2\u30fc\u30d5\u306e\u8868\u9762\u306b\u8868\u793a\u3055\u305b\u308b\u3002Scr&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,19],"tags":[],"class_list":["post-2731","post","type-post","status-publish","format-standard","hentry","category-pharo","category-tutorials"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/2731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=2731"}],"version-history":[{"count":0,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/2731\/revisions"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=2731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=2731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=2731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}