Label.js 2.7 KB

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