kopia lustrzana https://github.com/backface/turtlestitch
rodzic
d2f76901bb
commit
dcfbf63aa2
|
@ -32,6 +32,7 @@
|
|||
|
||||
<!-- turtlestitch additions -->
|
||||
<script type="text/javascript" src="stitchcode/turtleShepherd.js"></script>
|
||||
<script type="text/javascript" src="stitchcode/morphic.js"></script>
|
||||
<script type="text/javascript" src="stitchcode/blocks.js"></script>
|
||||
<script type="text/javascript" src="stitchcode/threads.js"></script>
|
||||
<script type="text/javascript" src="stitchcode/objects.js"></script>
|
||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 1.9 KiB |
|
@ -646,6 +646,40 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
|||
this.setExtent(this.world().extent()); // resume trackChanges
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.aboutTurtleStitch = function () {
|
||||
var dlg, aboutTxt, pic, world = this.world();
|
||||
|
||||
pic = Morph.fromImageURL('stitchcode/assets/turtle-logo.png');
|
||||
pic.setExtent(new Point(32, 32));
|
||||
|
||||
aboutTxt = 'TurtleStich! 2.1.0 beta\n\n'
|
||||
+ 'Copyright \u24B8 2018 Michael Aschauer\n\n'
|
||||
|
||||
+ 'TurtleStitch is developed by OSEDA - Association for\n'
|
||||
+ 'Development of Open Source Software in Education, Design\n'
|
||||
+ 'and Art and stitchcode.com - Visionary Embroidery.\n\n'
|
||||
|
||||
+ 'The project has been sponsored by netidee Open Innovation\n'
|
||||
+ '(Internet Foundation Austria) and kickstarter crowdfunding.\n\n'
|
||||
|
||||
+ 'TurtleStich is based on Snap!\n\n'
|
||||
|
||||
dlg = new DialogBoxMorph();
|
||||
dlg.inform(localize('About TurtleStitch'), localize(aboutTxt), world, pic);
|
||||
|
||||
btn1 = dlg.addButton(this.aboutSnap,
|
||||
'About Snap! ...'
|
||||
);
|
||||
btn2 = dlg.addButton(
|
||||
function () {
|
||||
window.open('http://www.turtlestitch.com', 'TurtleStitchWebsite');
|
||||
},
|
||||
'TurtleStitch! website',
|
||||
|
||||
);
|
||||
dlg.fixLayout();
|
||||
};
|
||||
|
||||
// create status display (inspired by beetleblocks)
|
||||
IDE_Morph.prototype.createStatusDisplay = function () {
|
||||
var frame,
|
||||
|
@ -1767,7 +1801,9 @@ IDE_Morph.prototype.snapMenu = function () {
|
|||
world = this.world();
|
||||
|
||||
menu = new MenuMorph(this);
|
||||
menu.addItem('About...', 'aboutSnap');
|
||||
menu.addItem('About TurtleStitch ...', 'aboutTurtleStitch');
|
||||
menu.addItem('About Snap! ...', 'aboutSnap');
|
||||
|
||||
menu.addLine();
|
||||
menu.addItem(
|
||||
'Reference manual',
|
||||
|
@ -1776,9 +1812,9 @@ IDE_Morph.prototype.snapMenu = function () {
|
|||
}
|
||||
);
|
||||
menu.addItem(
|
||||
'TurtleStich! website',
|
||||
'TurtleStitch! website',
|
||||
function () {
|
||||
window.open('http://'+window.location.hostname, 'SnapWebsite');
|
||||
window.open('http://www.turtlestitch.com', 'TurtleStitchWebsite');
|
||||
}
|
||||
);
|
||||
menu.addItem(
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
Morph.fromImageURL = function(url) {
|
||||
var m = new Morph();
|
||||
|
||||
m.texture = url;
|
||||
|
||||
m.drawNew = function() {
|
||||
this.image = newCanvas(this.extent());
|
||||
var context = this.image.getContext('2d');
|
||||
context.fillStyle = 'rgba(0,0,0,0)';
|
||||
context.fillRect(0, 0, this.width(), this.height());
|
||||
if (this.texture) {
|
||||
this.drawTexture(this.texture);
|
||||
}
|
||||
}
|
||||
|
||||
m.drawCachedTexture = function () {
|
||||
var context = this.image.getContext('2d');
|
||||
context.drawImage(
|
||||
this.cachedTexture,
|
||||
0,
|
||||
Math.round((this.height() - this.cachedTexture.height) / 2)
|
||||
);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
m.drawNew();
|
||||
|
||||
m.setExtent(new Point(m.cachedTexture.width, m.cachedTexture.height));
|
||||
|
||||
return m;
|
||||
}
|
|
@ -694,11 +694,11 @@ TurtleShepherd.prototype.toDST = function() {
|
|||
}
|
||||
|
||||
for (i=0; i < this.cache.length; i++) {
|
||||
|
||||
|
||||
if (this.cache[i].cmd == "color") {
|
||||
expArr.push(0x00);
|
||||
expArr.push(0x00);
|
||||
expArr.push(0x43);
|
||||
expArr.push(0xC3);
|
||||
encodeTajimaStitch(0,0,false);
|
||||
} else if (this.cache[i].cmd == "move") {
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue