Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/src/js/jgame.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 158 by tsugehara, Tue Sep 10 03:58:36 2013 UTC revision 160 by tsugehara, Tue Sep 10 08:25:39 2013 UTC
# Line 1698  var jg; Line 1698  var jg;
1698          };          };
1699    
1700          Label.prototype.setFontSize = function (size) {          Label.prototype.setFontSize = function (size) {
1701              var font = this.getFont();              var dom = document.createElement("div");
1702              var firstPos = font.indexOf(" ");              dom.style.font = this.getFont();
1703              this.setFont(size + "px " + font.substr(firstPos + 1));              dom.style.fontSize = size + "px";
1704                this.setFont(dom.style.font);
1705          };          };
1706    
1707          Label.prototype.getFontSize = function () {          Label.prototype.getFontSize = function () {
1708              var font = this.getFont();              var dom = document.createElement("div");
1709              var firstPos = font.indexOf(" ");              dom.style.font = this.getFont();
1710              try  {              return Number(dom.style.fontSize.substr(0, dom.style.fontSize.length - 2));
1711                  return parseInt(font.substr(0, firstPos - 2));          };
1712              } catch (ex) {  
1713              }          Label.prototype.getFontFamily = function () {
1714              return this.height;              var dom = document.createElement("div");
1715                dom.style.font = this.getFont();
1716                return dom.style.fontFamily;
1717            };
1718    
1719            Label.prototype.setFontFamily = function (family) {
1720                var dom = document.createElement("div");
1721                dom.style.font = this.getFont();
1722                dom.style.fontFamily = family;
1723                this.setFont(dom.style.font);
1724          };          };
1725    
1726          Label.prototype.setTextAlign = function (align) {          Label.prototype.setTextAlign = function (align) {

Legend:
Removed from v.158  
changed lines
  Added in v.160

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26