OSDN Git Service

tweetの修正
authornagoling <>
Mon, 16 Dec 2013 22:05:32 +0000 (07:05 +0900)
committernagomi <nagomi@192.168.1.23>
Mon, 16 Dec 2013 22:05:32 +0000 (07:05 +0900)
class.js

index 7066d21..7dfc67a 100644 (file)
--- a/class.js
+++ b/class.js
@@ -83,22 +83,20 @@ TTweet = enchant.Class.create(enchant.Sprite, {
                };
        },
        text : function(text, x, y) {
+               this.x = this.yukkuri.getX() - this.width/4 - this.yukkuri.getWidth() / 2;
+               this.y = this.yukkuri.getY() - this.height - this.yukkuri.getHeight() / 2;
+               x = this.x;
+               y = this.y;
                this.clear();
                this.opacity = 0.8;
 
                this.reDraw();
                with(this.image.context) {
-                       // var size = measureText(text);
                        fillStyle = 'black';
                        textAlign = 'center';
                        textBaseline = 'middle';
                        this.x = x;
                        this.y = y;
-                       // fillText(text,this.width/2,this.height/2);
-                       // console.log(size);
-                       // this.width = size;
-                       // console.log(this.width);
-                       // this.reDraw();
                        var textList = text.split("\n");
                        var len = textList.length / 2;
                        var height = (this.height/(1 + len));