kopia lustrzana https://github.com/backface/turtlestitch
GUI: Use new vector prompter for stage dimensions
also take out previous experimental code and make this new feature an official onepull/3/merge
rodzic
2c7d747bfc
commit
03b69769be
61
gui.js
61
gui.js
|
@ -2067,20 +2067,10 @@ IDE_Morph.prototype.settingsMenu = function () {
|
||||||
'Zoom blocks...',
|
'Zoom blocks...',
|
||||||
'userSetBlocksScale'
|
'userSetBlocksScale'
|
||||||
);
|
);
|
||||||
if (shiftClicked) {
|
|
||||||
menu.addItem(
|
menu.addItem(
|
||||||
'Stage width...',
|
'Stage size...',
|
||||||
'userSetStageWidth',
|
'userSetStageSize'
|
||||||
null,
|
|
||||||
new Color(100, 0, 0)
|
|
||||||
);
|
);
|
||||||
menu.addItem(
|
|
||||||
'Stage height...',
|
|
||||||
'userSetStageHeight',
|
|
||||||
null,
|
|
||||||
new Color(100, 0, 0)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
menu.addLine();
|
menu.addLine();
|
||||||
addPreference(
|
addPreference(
|
||||||
'Blurred shadows',
|
'Blurred shadows',
|
||||||
|
@ -3487,52 +3477,23 @@ IDE_Morph.prototype.setBlocksScale = function (num) {
|
||||||
|
|
||||||
// IDE_Morph stage size manipulation
|
// IDE_Morph stage size manipulation
|
||||||
|
|
||||||
IDE_Morph.prototype.userSetStageWidth = function () {
|
IDE_Morph.prototype.userSetStageSize = function () {
|
||||||
new DialogBoxMorph(
|
new DialogBoxMorph(
|
||||||
this,
|
this,
|
||||||
this.setStageWidth,
|
this.setStageExtent,
|
||||||
this
|
this
|
||||||
).prompt(
|
).promptVector(
|
||||||
"Stage width",
|
"Stage size",
|
||||||
StageMorph.prototype.dimensions.x.toString(),
|
StageMorph.prototype.dimensions,
|
||||||
|
new Point(480, 360),
|
||||||
|
'Stage width',
|
||||||
|
'Stage height',
|
||||||
this.world(),
|
this.world(),
|
||||||
null, // pic
|
null, // pic
|
||||||
null, // choices
|
null // msg
|
||||||
null, // read only
|
|
||||||
true // numeric
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.userSetStageHeight = function () {
|
|
||||||
new DialogBoxMorph(
|
|
||||||
this,
|
|
||||||
this.setStageHeight,
|
|
||||||
this
|
|
||||||
).prompt(
|
|
||||||
"Stage height",
|
|
||||||
StageMorph.prototype.dimensions.y.toString(),
|
|
||||||
this.world(),
|
|
||||||
null, // pic
|
|
||||||
null, // choices
|
|
||||||
null, // read only
|
|
||||||
true // numeric
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
IDE_Morph.prototype.setStageWidth = function (num) {
|
|
||||||
this.setStageExtent(new Point(
|
|
||||||
num,
|
|
||||||
(StageMorph.prototype.dimensions.y)
|
|
||||||
));
|
|
||||||
};
|
|
||||||
|
|
||||||
IDE_Morph.prototype.setStageHeight = function (num) {
|
|
||||||
this.setStageExtent(new Point(
|
|
||||||
(StageMorph.prototype.dimensions.x),
|
|
||||||
num
|
|
||||||
));
|
|
||||||
};
|
|
||||||
|
|
||||||
IDE_Morph.prototype.setStageExtent = function (aPoint) {
|
IDE_Morph.prototype.setStageExtent = function (aPoint) {
|
||||||
var myself = this,
|
var myself = this,
|
||||||
world = this.world(),
|
world = this.world(),
|
||||||
|
|
|
@ -2101,3 +2101,4 @@ ______
|
||||||
* GUI, Store: constrain minimum stage size to 480 x 180
|
* GUI, Store: constrain minimum stage size to 480 x 180
|
||||||
* GUI: Fixed #322, #324
|
* GUI: Fixed #322, #324
|
||||||
* Widgets: new “promptVector” dialog box feature
|
* Widgets: new “promptVector” dialog box feature
|
||||||
|
* GUI: Use new vector prompter for stage dimensions
|
||||||
|
|
Ładowanie…
Reference in New Issue