Cromon

Untitled

Sep 4th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var TextBox = function (position) {
  2.     UI.makeControl(this);
  3.     var local = this;
  4.  
  5.     this.hasFocus = false;
  6.     this.curText = "";
  7.     this.visibleText = "";
  8.     this.visibleTextStart = 0;
  9.     this.texQuad = new Quad({ });
  10.     this.texQuad.setSize(256, 32);
  11.     this.texQuad.setTexture("Interface\\ChatFrame\\UI-ChatInputBorder.blp");
  12.     this.texQuad.setColor(0xFFFFFFFF);
  13.     this.caretPos = 0;
  14.     this.caretQuad = new Quad({});
  15.     this.caretQuad.setSize(2, 15);
  16.     this.caretQuad.setPosition(0, 0);
  17.     this.caretQuad.setColor(0xFFFFFFFF);
  18.     this.prevCaretStr = "";
  19.     this.prevCaretLen = 0.0;
  20.     this.isCaretVisible = true;
  21.     this.caretEvent = new TimedEvent({ This: local, callback: (function(scope) { return function() { scope.caretUpdate(); };})(local), interval: 1000 });
  22.     this.caretEvent.enable();
  23.  
  24.     this.curPosition = [0, 0];
  25.  
  26.     if (typeof position !== "undefined") {
  27.         this.setPosition(position);
  28.         this.curPosition = { x: position.x, y: position.y };
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment