[]Sprite optimizeScrollRect = true 似乎有问题
this.initMask = function () {
this.mask = new Sprite();
this.mask.width = this.width;
this.mask.height = this.height;
this.mask.scrollRect = new Rectangle();
this.mask.scrollRect.setTo(0, 0, this.width, this.height);
this.mask.optimizeScrollRect = true;
this.addChild(this.mask);
}
this.initContent = function () {
this.content = new Box();
this.content.width = this.width;
this.content.autoSize = true;
this.content.y = this.scrollMode == DOWN_TO_TOP ? this.height : 1;
this.mask.addChild(this.content);
this.content.on(Event.MOUSE_DOWN, this, this.onMouseDown);
this.content.on(Event.MOUSE_WHEEL, this, this.onMousewheel);
}
this.createText = function (_content, _fontSize, _color, _width, _autoSize, _wordWrap, _ID) {
var txt = new Text();
txt.text = _content;
txt.cacheAs = 'bitmap';
txt.fontSize = _fontSize;
txt.bold = true;
txt.font = 'wordFont';
txt.color = _color;
txt.strokeColor = '#000000';
//txt.stroke = 2;
txt.width = _width;
txt.autoSize = _autoSize;
txt.wordWrap = _wordWrap;
txt.ID = _ID === undefined ? 0 : _ID;
this.content.addChild(txt);
return txt;
}
this.mask.optimizeScrollRect = true;
this.content.y = 0 的情况下 将不会显示内容 this.content.y = 1就显示正常了
this.mask.optimizeScrollRect = false;
this.content.y = 0 也会正常显示
开发的时候不知道是哪个版本 是正常的 现在1.5.3版本出问题了 不知道是哪个版本改动出了问题
this.mask = new Sprite();
this.mask.width = this.width;
this.mask.height = this.height;
this.mask.scrollRect = new Rectangle();
this.mask.scrollRect.setTo(0, 0, this.width, this.height);
this.mask.optimizeScrollRect = true;
this.addChild(this.mask);
}
this.initContent = function () {
this.content = new Box();
this.content.width = this.width;
this.content.autoSize = true;
this.content.y = this.scrollMode == DOWN_TO_TOP ? this.height : 1;
this.mask.addChild(this.content);
this.content.on(Event.MOUSE_DOWN, this, this.onMouseDown);
this.content.on(Event.MOUSE_WHEEL, this, this.onMousewheel);
}
this.createText = function (_content, _fontSize, _color, _width, _autoSize, _wordWrap, _ID) {
var txt = new Text();
txt.text = _content;
txt.cacheAs = 'bitmap';
txt.fontSize = _fontSize;
txt.bold = true;
txt.font = 'wordFont';
txt.color = _color;
txt.strokeColor = '#000000';
//txt.stroke = 2;
txt.width = _width;
txt.autoSize = _autoSize;
txt.wordWrap = _wordWrap;
txt.ID = _ID === undefined ? 0 : _ID;
this.content.addChild(txt);
return txt;
}
this.mask.optimizeScrollRect = true;
this.content.y = 0 的情况下 将不会显示内容 this.content.y = 1就显示正常了
this.mask.optimizeScrollRect = false;
this.content.y = 0 也会正常显示
开发的时候不知道是哪个版本 是正常的 现在1.5.3版本出问题了 不知道是哪个版本改动出了问题
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
cuixueying
赞同来自: