Fix: set shortcutText bounds of PlayAppButton

This commit is contained in:
2019-08-18 16:13:51 +09:00
parent 48d50b3f35
commit bed7e70aa1
2 changed files with 53 additions and 0 deletions
@@ -46,10 +46,33 @@ function PlayAppButton(x, y) {
// this.setIconSize(40); // this.setIconSize(40);
// this.setShortcutText("[단축키]"); // this.setShortcutText("[단축키]");
this.setShorcutTextBounds();
this.addIcon("home"); this.addIcon("home");
this.setIconSize(80); this.setIconSize(80);
} }
PlayAppButton.prototype.setShorcutTextBounds = function() {
var offsetX = 10;
var offsetY = -20;
var textWidth = PlayAppButton.WIDTH - offsetX * 2;
this.shortcutText.font = this.setting.font;
this.shortcutText.fontSize = this.setting.fontSize;
this.shortcutText.style.align = "center";
this.shortcutText.style.boundsAlignH = "center";
this.shortcutText.style.boundsAlignV = "top"
this.shortcutText.style.wordWrap = true;
this.shortcutText.style.wordWrapWidth = textWidth;
this.shortcutText.style.fill = "white";
// this.shortcutText.style.backgroundColor = "black";
this.shortcutText.anchor.set(0, 0);
this.shortcutText.x = offsetX;
this.shortcutText.setTextBounds(0, offsetY, textWidth, 200);
}
PlayAppButton.prototype.setInputEnabled = function(isEnabled) { PlayAppButton.prototype.setInputEnabled = function(isEnabled) {
this.strokeSprite.inputEnabled = isEnabled; this.strokeSprite.inputEnabled = isEnabled;
this.buttonSprite.inputEnabled = isEnabled; this.buttonSprite.inputEnabled = isEnabled;
+30
View File
@@ -0,0 +1,30 @@
<?php
header('Content-Type: application/json');
// get parameters from client
$maestroID = $_POST["maestroID"];
include "./../lib/json_builder.php";
include "./../lib/connect_db.php";
$jsonBuilder = new JsonBuilder();
$dbConnector = new DBConnector();
$isConnected = $dbConnector->connectDB();
if (!$isConnected) {
$jsonBuilder->setErrorMessage("DB connection : failed");
$jsonBuilder->sendResultFail();
exit;
}
include "./../db/db_method_container.php";
include "./../db/menu_collection.php";
$menuCollection = new MenuCollection($dbConnector->getMysqli());
$allowEditEntercode = $menuCollection->getAllowEditEntercode($maestroID);
$jsonBuilder->setData("allowEditEntercode", $allowEditEntercode);
$jsonBuilder->sendResultSuccess();
?>