Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created November 26, 2016 19:42
Show Gist options
  • Save triacontane/7a599b5f1acf7a3451a6a93fc72be4c5 to your computer and use it in GitHub Desktop.
Save triacontane/7a599b5f1acf7a3451a6a93fc72be4c5 to your computer and use it in GitHub Desktop.
イベント間で線を引くサンプル
var sprite = new Sprite();
var bitmap = new Bitmap(816, 624);
var ctx = bitmap.context;
ctx.beginPath();
var x1 = $gameMap.event(this._eventId).screenX();
var y1 = $gameMap.event(this._eventId).screenY() - 24;
ctx.moveTo(x1, y1);
var x2 = $gameMap.event(10).screenX();
var y2 = $gameMap.event(10).screenY() - 24;
ctx.lineTo(x2,y2);ctx.stroke();
sprite.bitmap = bitmap;
SceneManager._scene.addChild(sprite);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment