Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createjsで文字に座布団をひく #86

Closed
HAKASHUN opened this issue Feb 25, 2015 · 2 comments
Closed

createjsで文字に座布団をひく #86

HAKASHUN opened this issue Feb 25, 2015 · 2 comments
Labels

Comments

@HAKASHUN
Copy link
Owner

http://jsfiddle.net/ybJM4/

http://jsfiddle.net/lannymcnie/6vUVr/

@HAKASHUN
Copy link
Owner Author

下記をTextのdraw時に設定すれば、きれいにoutlineが出る

// 座布団文字のために値を修正
ctx.miterLimit = 2;
ctx.lineJoin = 'circle';

createjsがサポートしていないので、以下のパッチをあてて、createjsをoverrideする

/**
   * Text draw patch
   */
  createjs.Text.prototype.draw = function(ctx, ignoreCache) {
    if (this.DisplayObject_draw(ctx, ignoreCache)) {
      return true;
    }

    var col = this.color || "#000";
    if (this.outline) {
      ctx.strokeStyle = col;
      ctx.lineWidth = this.outline * 1;

      // 座布団文字のために値を修正
      ctx.miterLimit = 2;
      ctx.lineJoin = 'circle';
    } else {
      ctx.fillStyle = col;
    }

    this._drawText(this._prepContext(ctx));
    return true;
  };

@HAKASHUN
Copy link
Owner Author

CreateJS/EaselJS#571
プルリクだした

@HAKASHUN HAKASHUN changed the title creeatejsで文字に座布団をひく createjsで文字に座布団をひく May 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant