| 43 |
Keytype[Keytype["Esc"] = 6] = "Esc"; |
Keytype[Keytype["Esc"] = 6] = "Esc"; |
| 44 |
})(jg.Keytype || (jg.Keytype = {})); |
})(jg.Keytype || (jg.Keytype = {})); |
| 45 |
var Keytype = jg.Keytype; |
var Keytype = jg.Keytype; |
| 46 |
|
|
| 47 |
(function (ShapeStyle) { |
(function (ShapeStyle) { |
| 48 |
ShapeStyle[ShapeStyle["Unknown"] = 0] = "Unknown"; |
ShapeStyle[ShapeStyle["Unknown"] = 0] = "Unknown"; |
| 49 |
|
|
| 50 |
ShapeStyle[ShapeStyle["Stroke"] = 1] = "Stroke"; |
ShapeStyle[ShapeStyle["Stroke"] = 1] = "Stroke"; |
| 51 |
|
|
| 52 |
ShapeStyle[ShapeStyle["Fill"] = 2] = "Fill"; |
ShapeStyle[ShapeStyle["Fill"] = 2] = "Fill"; |
| 53 |
})(jg.ShapeStyle || (jg.ShapeStyle = {})); |
})(jg.ShapeStyle || (jg.ShapeStyle = {})); |
| 54 |
var ShapeStyle = jg.ShapeStyle; |
var ShapeStyle = jg.ShapeStyle; |
| 55 |
|
|
| 56 |
(function (ShapeType) { |
(function (ShapeType) { |
| 57 |
ShapeType[ShapeType["Unknown"] = 0] = "Unknown"; |
ShapeType[ShapeType["Unknown"] = 0] = "Unknown"; |
| 58 |
ShapeType[ShapeType["Rect"] = 1] = "Rect"; |
ShapeType[ShapeType["Rect"] = 1] = "Rect"; |
| 757 |
|
|
| 758 |
E.prototype.show = function () { |
E.prototype.show = function () { |
| 759 |
this.opacity = 1; |
this.opacity = 1; |
| 760 |
|
this.updated(); |
| 761 |
}; |
}; |
| 762 |
E.prototype.hide = function () { |
E.prototype.hide = function () { |
| 763 |
this.opacity = 0; |
this.opacity = 0; |
| 764 |
|
this.updated(); |
| 765 |
}; |
}; |
| 766 |
return E; |
return E; |
| 767 |
})(); |
})(); |
| 811 |
Shape.prototype.setLineWidth = function (width) { |
Shape.prototype.setLineWidth = function (width) { |
| 812 |
this.setDrawOption("lineWidth", width); |
this.setDrawOption("lineWidth", width); |
| 813 |
}; |
}; |
| 814 |
|
|
| 815 |
Shape.prototype.getLineWidth = function () { |
Shape.prototype.getLineWidth = function () { |
| 816 |
return this.getDrawOption("lineWidth"); |
return this.getDrawOption("lineWidth"); |
| 817 |
}; |
}; |
| 821 |
this.setDrawOption("strokeStyle", color); else |
this.setDrawOption("strokeStyle", color); else |
| 822 |
this.setDrawOption("fillStyle", color); |
this.setDrawOption("fillStyle", color); |
| 823 |
}; |
}; |
| 824 |
|
|
| 825 |
Shape.prototype.getColor = function () { |
Shape.prototype.getColor = function () { |
| 826 |
if (this.style == jg.ShapeStyle.Stroke) |
if (this.style == jg.ShapeStyle.Stroke) |
| 827 |
return this.getDrawOption("strokeStyle"); else |
return this.getDrawOption("strokeStyle"); else |
| 2037 |
var th = this.tile.tileHeight; |
var th = this.tile.tileHeight; |
| 2038 |
c.drawImage(this.image, (chip % this.sep) * tw, Math.floor(chip / this.sep) * th, tw, th, x * tw, y * th, tw, th); |
c.drawImage(this.image, (chip % this.sep) * tw, Math.floor(chip / this.sep) * th, tw, th, x * tw, y * th, tw, th); |
| 2039 |
}; |
}; |
| 2040 |
|
|
| 2041 |
|
ChipSet.prototype.getChips = function () { |
| 2042 |
|
var len = this.count(); |
| 2043 |
|
var sprite = new jg.Sprite(this.image); |
| 2044 |
|
var buf = new jg.BufferedRenderer(sprite); |
| 2045 |
|
var ret = []; |
| 2046 |
|
var w = this.tile.tileWidth; |
| 2047 |
|
var h = this.tile.tileHeight; |
| 2048 |
|
var area = { |
| 2049 |
|
x: 0, |
| 2050 |
|
y: 0, |
| 2051 |
|
width: w, |
| 2052 |
|
height: h |
| 2053 |
|
}; |
| 2054 |
|
buf.renderUnit(sprite); |
| 2055 |
|
|
| 2056 |
|
for (var i = 0; i < len; i++) { |
| 2057 |
|
ret.push(buf.createSprite({ |
| 2058 |
|
x: (i % this.sep) * w, |
| 2059 |
|
y: Math.floor(i / this.sep) * h, |
| 2060 |
|
width: w, |
| 2061 |
|
height: h |
| 2062 |
|
}, area, area)); |
| 2063 |
|
} |
| 2064 |
|
return ret; |
| 2065 |
|
}; |
| 2066 |
return ChipSet; |
return ChipSet; |
| 2067 |
})(); |
})(); |
| 2068 |
jg.ChipSet = ChipSet; |
jg.ChipSet = ChipSet; |
| 2223 |
|
|
| 2224 |
context.drawImage(this.canvas, src.x, src.y, src.width, src.height, dist.x, dist.y, dist.width, dist.height); |
context.drawImage(this.canvas, src.x, src.y, src.width, src.height, dist.x, dist.y, dist.width, dist.height); |
| 2225 |
}; |
}; |
| 2226 |
|
|
| 2227 |
|
Tile.prototype.getChips = function () { |
| 2228 |
|
var ret = []; |
| 2229 |
|
var len = this.chips.length; |
| 2230 |
|
for (var i = 0; i < len; i++) |
| 2231 |
|
ret = ret.concat(this.chips[i].getChips()); |
| 2232 |
|
return ret; |
| 2233 |
|
}; |
| 2234 |
return Tile; |
return Tile; |
| 2235 |
})(jg.E); |
})(jg.E); |
| 2236 |
jg.Tile = Tile; |
jg.Tile = Tile; |