PIXI Controls: Edit Mode Text
This commit is contained in:
parent
2457c283dd
commit
dc4bb1389a
1 changed files with 29 additions and 1 deletions
|
@ -120,6 +120,30 @@ ONSControls.createAdditionalButtons = function() {
|
||||||
this._showButton = showButton;
|
this._showButton = showButton;
|
||||||
}
|
}
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
// * Edit Mode Interface
|
||||||
|
//=============================================================================
|
||||||
|
ONSControls.createEditModeInterface = function() {
|
||||||
|
const headerText = new PIXI.Text("Режим редактирования", {
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 24,
|
||||||
|
fill: 0xaaaaaa,
|
||||||
|
align: 'center'
|
||||||
|
});
|
||||||
|
const tipText = new PIXI.Text("Здась вы можете свободно перемещать элементы управления по экрану.\nЧтобы выйти из этого режима, нажмите кнопку \"Назад\" вашего Android устройства.", {
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 16,
|
||||||
|
fill: 0xaaaaaa,
|
||||||
|
align: 'center'
|
||||||
|
});
|
||||||
|
headerText.anchor.set(0.5);
|
||||||
|
headerText.visible = false;
|
||||||
|
headerText.addChild(tipText);
|
||||||
|
tipText.anchor.set(0.5);
|
||||||
|
tipText.y = 48;
|
||||||
|
this._controlsCanvas.stage.addChild(headerText);
|
||||||
|
this._editModeText = headerText;
|
||||||
|
}
|
||||||
|
//=============================================================================
|
||||||
// * Check idle animation (spinning buttons)
|
// * Check idle animation (spinning buttons)
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
ONSControls.idleAnimation = function() {
|
ONSControls.idleAnimation = function() {
|
||||||
|
@ -360,11 +384,15 @@ ONSControls.openEditMode = function() {
|
||||||
for (elem of this.getControlElements()) {
|
for (elem of this.getControlElements()) {
|
||||||
this.setupDragNDrop(elem);
|
this.setupDragNDrop(elem);
|
||||||
}
|
}
|
||||||
|
this._editModeText.visible = true;
|
||||||
|
this._editModeText.x = this._controlsCanvas.screen.width / 2;
|
||||||
|
this._editModeText.y = this._controlsCanvas.screen.height / 2;
|
||||||
}
|
}
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// * Close Edit Mode
|
// * Close Edit Mode
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
ONSControls.closeEditMode = function() {
|
ONSControls.closeEditMode = function() {
|
||||||
|
this._editModeText.visible = false;
|
||||||
Graphics._canvas.hidden = false;
|
Graphics._canvas.hidden = false;
|
||||||
this.clearInteractive();
|
this.clearInteractive();
|
||||||
this.setupInteractive();
|
this.setupInteractive();
|
||||||
|
@ -751,7 +779,6 @@ Window_OmoMenuOptionsONSControls.prototype.drawItem = function (index) {
|
||||||
if (data) {
|
if (data) {
|
||||||
// Draw Header
|
// Draw Header
|
||||||
this.contents.drawText(data.header, rect.x + 50, rect.y, rect.width, 24);
|
this.contents.drawText(data.header, rect.x + 50, rect.y, rect.width, 24);
|
||||||
if (!data.isBar) {console.log(this.contents);}
|
|
||||||
// Update option bar
|
// Update option bar
|
||||||
if (data.isBar) {
|
if (data.isBar) {
|
||||||
this.updateOptionBar(index, data.option, data.persent);
|
this.updateOptionBar(index, data.option, data.persent);
|
||||||
|
@ -904,6 +931,7 @@ ONSControls.initialize = function() {
|
||||||
this.createDPad();
|
this.createDPad();
|
||||||
this.createBumpers();
|
this.createBumpers();
|
||||||
this.createAdditionalButtons();
|
this.createAdditionalButtons();
|
||||||
|
this.createEditModeInterface();
|
||||||
this.updateButtons();
|
this.updateButtons();
|
||||||
this.setupInteractive();
|
this.setupInteractive();
|
||||||
this.disableTouch();
|
this.disableTouch();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue