Label.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. function Label() {
  2. }
  3. Duktape.fin(Label.prototype, function (x) {
  4. if (x === Label.prototype) {
  5. return;
  6. }
  7. Polycode.Label__delete(x.__ptr)
  8. })
  9. Label.prototype.setText = function(text) {
  10. Polycode.Label_setText(this.__ptr, text)
  11. }
  12. Label.prototype.getText = function() {
  13. return Polycode.Label_getText(this.__ptr)
  14. }
  15. Label.prototype.getTextWidthForString = function(text) {
  16. return Polycode.Label_getTextWidthForString(this.__ptr, text)
  17. }
  18. Label.prototype.getTextHeightForString = function(text) {
  19. return Polycode.Label_getTextHeightForString(this.__ptr, text)
  20. }
  21. Label.prototype.getTextWidth = function() {
  22. return Polycode.Label_getTextWidth(this.__ptr)
  23. }
  24. Label.prototype.getTextHeight = function() {
  25. return Polycode.Label_getTextHeight(this.__ptr)
  26. }
  27. Label.prototype.setColorForRange = function(color,rangeStart,rangeEnd) {
  28. Polycode.Label_setColorForRange(this.__ptr, color,rangeStart,rangeEnd)
  29. }
  30. Label.prototype.clearColors = function() {
  31. Polycode.Label_clearColors(this.__ptr)
  32. }
  33. Label.prototype.getColorForIndex = function(index) {
  34. var retVal = new Color()
  35. retVal.__ptr = Polycode.Label_getColorForIndex(this.__ptr, index)
  36. return retVal
  37. }
  38. Label.prototype.getPremultiplyAlpha = function() {
  39. return Polycode.Label_getPremultiplyAlpha(this.__ptr)
  40. }
  41. Label.prototype.setPremultiplyAlpha = function(val) {
  42. Polycode.Label_setPremultiplyAlpha(this.__ptr, val)
  43. }
  44. Label.prototype.setFont = function(newFont) {
  45. Polycode.Label_setFont(this.__ptr, newFont)
  46. }
  47. Label.prototype.getFont = function() {
  48. var retVal = new Font()
  49. retVal.__ptr = Polycode.Label_getFont(this.__ptr)
  50. return retVal
  51. }
  52. Label.prototype.setSize = function(newSize) {
  53. Polycode.Label_setSize(this.__ptr, newSize)
  54. }
  55. Label.prototype.getSize = function() {
  56. return Polycode.Label_getSize(this.__ptr)
  57. }
  58. Label.prototype.getAntialiasMode = function() {
  59. return Polycode.Label_getAntialiasMode(this.__ptr)
  60. }
  61. Label.prototype.setAntialiasMode = function(newMode) {
  62. Polycode.Label_setAntialiasMode(this.__ptr, newMode)
  63. }
  64. Label.prototype.getBaselineAdjust = function() {
  65. return Polycode.Label_getBaselineAdjust(this.__ptr)
  66. }
  67. Label.prototype.setBackgroundColor = function(color) {
  68. Polycode.Label_setBackgroundColor(this.__ptr, color)
  69. }
  70. Label.prototype.setForegroundColor = function(color) {
  71. Polycode.Label_setForegroundColor(this.__ptr, color)
  72. }
  73. Label.prototype.setColors = function(backgroundColor,foregroundColor) {
  74. Polycode.Label_setColors(this.__ptr, backgroundColor,foregroundColor)
  75. }
  76. Label.prototype.getBackgroundColor = function() {
  77. var retVal = new Color()
  78. retVal.__ptr = Polycode.Label_getBackgroundColor(this.__ptr)
  79. return retVal
  80. }
  81. Label.prototype.getForegroundColor = function() {
  82. var retVal = new Color()
  83. retVal.__ptr = Polycode.Label_getForegroundColor(this.__ptr)
  84. return retVal
  85. }
  86. Label.prototype.optionsChanged = function() {
  87. return Polycode.Label_optionsChanged(this.__ptr)
  88. }