kopia lustrzana https://github.com/backface/turtlestitch
move logo change (cleanup)
rodzic
aadd14a09c
commit
293b817c11
|
@ -5,6 +5,17 @@
|
|||
// Force flat design
|
||||
IDE_Morph.prototype.setDefaultDesign = IDE_Morph.prototype.setFlatDesign;
|
||||
|
||||
// change logo
|
||||
IDE_Morph.prototype.originalCreateLogo = IDE_Morph.prototype.createLogo;
|
||||
IDE_Morph.prototype.createLogo = function () {
|
||||
this.originalCreateLogo();
|
||||
if (MorphicPreferences.isFlat) {
|
||||
this.logo.texture = 'stitchcode/stitchcode_logo_small.png';
|
||||
} else {
|
||||
this.logo.texture = 'stitchcode/stitchcode_logo_small_black.png';
|
||||
}
|
||||
this.logo.drawNew();
|
||||
}
|
||||
|
||||
function debug_msg(st,clear) {
|
||||
o = new String();
|
||||
|
|
|
@ -2,73 +2,6 @@
|
|||
// this file includes changes just things to deactivate/hide some
|
||||
// stuff and functions we don't need.
|
||||
|
||||
IDE_Morph.prototype.buildPanes = function () {
|
||||
this.createLogo();
|
||||
this.createControlBar();
|
||||
this.createCategories();
|
||||
this.createPalette();
|
||||
this.createStage();
|
||||
this.createSpriteBar();
|
||||
this.createSpriteEditor();
|
||||
this.createCorralBar();
|
||||
this.createCorral();
|
||||
this.corral.isVisible = false;
|
||||
this.corralBar.isVisible= false;
|
||||
this.spriteBar.isVisible= false;
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.createLogo = function () {
|
||||
var myself = this;
|
||||
|
||||
if (this.logo) {
|
||||
this.logo.destroy();
|
||||
}
|
||||
|
||||
this.logo = new Morph();
|
||||
if (MorphicPreferences.isFlat) {
|
||||
this.logo.texture = 'stitchcode/stitchcode_logo_small.png';
|
||||
} else {
|
||||
this.logo.texture = 'stitchcode/stitchcode_logo_small_black.png';
|
||||
}
|
||||
this.logo.drawNew = function () {
|
||||
this.image = newCanvas(this.extent());
|
||||
var context = this.image.getContext('2d'),
|
||||
gradient = context.createLinearGradient(
|
||||
0,
|
||||
0,
|
||||
this.width(),
|
||||
0
|
||||
);
|
||||
gradient.addColorStop(0, 'black');
|
||||
gradient.addColorStop(0.5, myself.frameColor.toString());
|
||||
context.fillStyle = MorphicPreferences.isFlat ?
|
||||
myself.frameColor.toString() : gradient;
|
||||
context.fillRect(0, 0, this.width(), this.height());
|
||||
if (this.texture) {
|
||||
this.drawTexture(this.texture);
|
||||
}
|
||||
};
|
||||
|
||||
this.logo.drawCachedTexture = function () {
|
||||
var context = this.image.getContext('2d');
|
||||
context.drawImage(
|
||||
this.cachedTexture,
|
||||
5,
|
||||
Math.round((this.height() - this.cachedTexture.height) / 2)
|
||||
);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
this.logo.mouseClickLeft = function () {
|
||||
myself.snapMenu();
|
||||
};
|
||||
|
||||
this.logo.color = new Color();
|
||||
this.logo.setExtent(new Point(200, 28)); // dimensions are fixed
|
||||
this.add(this.logo);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// IDE_Morph layout
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue