1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| import { tween, Size } from 'cc';
private previousPage: number = 0; private currentPage: number = 0;
private updateIndicatorHighlight() { const indicator = this._view._PageC_banner.indicator; if (!indicator) return;
const markers = indicator.node.children; const currentPage = this._view._PageC_banner.getCurrentPageIndex();
for (let i = 0; i < markers.length; i++) { const sprite = markers[i].getComponent(Sprite); if (sprite) { let uiTransform = markers[i].getComponent(UITransform);
if (i === currentPage) { if (currentPage > this.previousPage) { Tool.setImgSprite(markers[i], "texture/illustrate/UI_Introduce_Point1", UIPnlillustrateLogic.bundleName); uiTransform.setContentSize(this.markerWidth2, this.markerHeight); tween(uiTransform) .to(0.2, { contentSize: new Size(this.markerWidth1, this.markerHeight) }, { easing: 'smooth' }) .start(); } else { Tool.setImgSprite(markers[i], "texture/illustrate/UI_Introduce_Point1", UIPnlillustrateLogic.bundleName); uiTransform.setContentSize(this.markerWidth2, this.markerHeight); tween(uiTransform) .to(0.2, { contentSize: new Size(this.markerWidth1, this.markerHeight) }, { easing: 'smooth' }) .start(); } } else { Tool.setImgSprite(markers[i], "texture/illustrate/UI_Introduce_Point2", UIPnlillustrateLogic.bundleName); tween(uiTransform) .to(0.2, { contentSize: new Size(this.markerWidth2, this.markerHeight) }, { easing: 'smooth' }) .start(); } } }
this.previousPage = currentPage; }
|