[add] all
This commit is contained in:
BIN
__MACOSX/._project.json
Normal file
BIN
__MACOSX/._project.json
Normal file
Binary file not shown.
BIN
__MACOSX/assets/._super-layout.ts
Normal file
BIN
__MACOSX/assets/._super-layout.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/core/._super-layout.ts
Normal file
BIN
__MACOSX/assets/core/._super-layout.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._.DS_Store
Normal file
BIN
__MACOSX/assets/scripts/._.DS_Store
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._auto-center.ts
Normal file
BIN
__MACOSX/assets/scripts/._auto-center.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._baseItem.ts
Normal file
BIN
__MACOSX/assets/scripts/._baseItem.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._baseMain.ts
Normal file
BIN
__MACOSX/assets/scripts/._baseMain.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._horizontal.ts
Normal file
BIN
__MACOSX/assets/scripts/._horizontal.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._main.ts
Normal file
BIN
__MACOSX/assets/scripts/._main.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._page.ts
Normal file
BIN
__MACOSX/assets/scripts/._page.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._simple.ts
Normal file
BIN
__MACOSX/assets/scripts/._simple.ts
Normal file
Binary file not shown.
BIN
__MACOSX/assets/scripts/._vertical.ts
Normal file
BIN
__MACOSX/assets/scripts/._vertical.ts
Normal file
Binary file not shown.
BIN
assets/.DS_Store
vendored
Normal file
BIN
assets/.DS_Store
vendored
Normal file
Binary file not shown.
12
assets/core.meta
Normal file
12
assets/core.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "f0ee3644-8728-4594-afaa-1c4ce0a5ff7a",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
1443
assets/core/super-layout.ts
Normal file
1443
assets/core/super-layout.ts
Normal file
File diff suppressed because it is too large
Load Diff
9
assets/core/super-layout.ts.meta
Normal file
9
assets/core/super-layout.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "04016b59-70f0-4a96-8705-735fcab997bd",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
544
assets/core/super-scrollview.ts
Normal file
544
assets/core/super-scrollview.ts
Normal file
@@ -0,0 +1,544 @@
|
||||
import SuperLayout from "./super-layout";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
const quintEaseOut = (time: number) => {
|
||||
time -= 1;
|
||||
return (time * time * time * time * time + 1)
|
||||
};
|
||||
const EPSILON = 1e-4
|
||||
const OUT_OF_BOUNDARY_BREAKING_FACTOR = 0.05;
|
||||
var _tempVec2 = new cc.Vec2()
|
||||
export enum ScrollViewDirection {
|
||||
HORIZONTAL,
|
||||
VERTICAL,
|
||||
NONE,
|
||||
}
|
||||
|
||||
@ccclass
|
||||
export default class SuperScrollview extends cc.ScrollView {
|
||||
private direction: ScrollViewDirection = ScrollViewDirection.NONE
|
||||
private _layout: SuperLayout
|
||||
@property({
|
||||
tooltip: "注意!向上传递事件只会发送当前滑动相反方向,如果开启horizontal则会发送vertical事件。如果开启vertical则会发送horizontal事件。同时开启horizontal和vertical 不会发送任何事件"
|
||||
}) isTransmitEvent: boolean = false
|
||||
@property pullRefresh: boolean = false
|
||||
@property({
|
||||
displayName: "顶部偏移量",
|
||||
tooltip: "下拉时超过此偏移会发送下拉事件",
|
||||
visible: function () { return (this as any).pullRefresh }
|
||||
}) headerOutOffset: number = 200
|
||||
@property({
|
||||
displayName: "满足触发Header的倍数",
|
||||
visible: function () { return (this as any).pullRefresh }
|
||||
}) headerMultiple: number = 2
|
||||
@property({
|
||||
displayName: "底部偏移量",
|
||||
tooltip: "上拉时超过此偏移会发送上拉事件",
|
||||
visible: function () { return (this as any).pullRefresh }
|
||||
}) footerOutOffset: number = 200
|
||||
@property({
|
||||
displayName: "满足触发Footer的倍数",
|
||||
visible: function () { return (this as any).pullRefresh }
|
||||
}) footerMultiple: number = 2
|
||||
@property({
|
||||
type: cc.Component.EventHandler,
|
||||
visible: function () { return (this as any).pullRefresh }
|
||||
}) headerEvents: cc.Component.EventHandler[] = []
|
||||
@property({
|
||||
type: cc.Component.EventHandler,
|
||||
visible: function () { return (this as any).pullRefresh }
|
||||
}) footerEvents: cc.Component.EventHandler[] = []
|
||||
prevLocation: cc.Vec2 = new cc.Vec2()
|
||||
location: cc.Vec2 = new cc.Vec2()
|
||||
set autoScrolling(value: boolean) { (this as any)._autoScrolling = value }
|
||||
private _touchBeganPosition = new cc.Vec2()
|
||||
private _touchEndPosition = new cc.Vec2()
|
||||
private isMoveHeader: boolean = false
|
||||
private isMoveFooter: boolean = false
|
||||
private isLockHeader: boolean = false
|
||||
private isLockFooter: boolean = false
|
||||
private headerProgress: number = 0
|
||||
private footerProgress: number = 0
|
||||
private isCustomScroll: boolean = false
|
||||
canTouchMove: boolean = true
|
||||
get view(): cc.Node { return this["_view"] }
|
||||
onLoad() {
|
||||
if (this.layout && this.layout.autoCenter) {
|
||||
this.brake = 0.7
|
||||
}
|
||||
}
|
||||
public onEnable() {
|
||||
super.onEnable()
|
||||
this.node.on("scroll-ended-with-threshold", this.dispatchPageTurningEvent, this)
|
||||
}
|
||||
public onDisable() {
|
||||
super.onDisable()
|
||||
this.node.off("scroll-ended-with-threshold", this.dispatchPageTurningEvent, this)
|
||||
}
|
||||
get layout() {
|
||||
if (!this._layout) {
|
||||
this._layout = this.content && this.content.getComponent(SuperLayout)
|
||||
}
|
||||
return this._layout
|
||||
}
|
||||
private isCallSoonFinish: boolean = false
|
||||
get _curPageIdx() {
|
||||
return this.layout["_currPageIndex"]
|
||||
}
|
||||
getPages() {
|
||||
return new Array(this.layout.itemTotal)
|
||||
}
|
||||
protected _getContentTopBoundary() {
|
||||
if (!this.content) {
|
||||
return -1
|
||||
}
|
||||
let offset = this.layout.isOfTopBoundary == 0 ? this["_topBoundary"] : this.layout.isOfTopBoundary
|
||||
return offset
|
||||
}
|
||||
protected _getContentBottomBoundary() {
|
||||
if (!this.content) {
|
||||
return -1
|
||||
}
|
||||
let offset = this.layout.isOfButtomBoundary == 0 ? this["_bottomBoundary"] : this.layout.isOfButtomBoundary
|
||||
return offset
|
||||
}
|
||||
protected _getContentLeftBoundary() {
|
||||
if (!this.content) {
|
||||
return -1
|
||||
}
|
||||
let offset = this.layout.isOfLeftBoundary == 0 ? this["_leftBoundary"] : this.layout.isOfLeftBoundary
|
||||
return offset
|
||||
}
|
||||
protected _getContentRightBoundary() {
|
||||
if (!this.content) {
|
||||
return -1
|
||||
}
|
||||
let offset = this.layout.isOfRightBoundary == 0 ? this["_rightBoundary"] : this.layout.isOfRightBoundary
|
||||
return offset
|
||||
}
|
||||
|
||||
protected _onTouchBegan(event: cc.Event.EventTouch, captureListeners?: Node[]) {
|
||||
this.isCallSoonFinish = false
|
||||
this.isCustomScroll = false
|
||||
this.layout["onTouchBegin"]()
|
||||
if (!this.canTouchMove) return
|
||||
this.direction = ScrollViewDirection.NONE
|
||||
if (this.layout.isPageView) {
|
||||
_tempVec2 = event.getLocation()
|
||||
// cc.Vec2.set(this._touchBeganPosition, _tempVec2.x, _tempVec2.y)
|
||||
this._touchBeganPosition = cc.v2(_tempVec2.x, _tempVec2.y)
|
||||
}
|
||||
super["_onTouchBegan"](event, captureListeners)
|
||||
if (this.isTransmitEvent) {
|
||||
this.transmitEvent(event, cc.Node.EventType.TOUCH_START)
|
||||
}
|
||||
}
|
||||
protected _onTouchMoved(event: cc.Event.EventTouch, captureListeners: any) {
|
||||
this.isCallSoonFinish = false
|
||||
this.isCustomScroll = false
|
||||
|
||||
if (!this.canTouchMove) return
|
||||
if (this.isTransmitEvent) {
|
||||
if (this.direction == ScrollViewDirection.NONE) {
|
||||
var start = event.getStartLocation()
|
||||
var curre = event.getLocation()
|
||||
var xOffset = Math.abs(start.x - curre.x)
|
||||
var yOffset = Math.abs(start.y - curre.y)
|
||||
if (xOffset > yOffset) {
|
||||
// 本ScrollView滑动方向过程中达到一定偏移量是也可以向上发送事件
|
||||
// if (this.vertical) {
|
||||
// if (xOffset - yOffset > 50) {
|
||||
// this.direction = UIScrollViewDirection.HORIZONTAL
|
||||
// }
|
||||
// }
|
||||
this.direction = ScrollViewDirection.HORIZONTAL
|
||||
|
||||
} else if (yOffset > xOffset) {
|
||||
// 本ScrollView滑动方向过程中达到一定偏移量是也可以向上发送事件
|
||||
// if (this.horizontal) {
|
||||
// if (yOffset - xOffset > 50) {
|
||||
// this.direction = UIScrollViewDirection.VERTICAL
|
||||
// }
|
||||
// }
|
||||
this.direction = ScrollViewDirection.VERTICAL
|
||||
}
|
||||
}
|
||||
var canTransmit = (this.vertical && this.direction === ScrollViewDirection.HORIZONTAL) || this.horizontal && this.direction == ScrollViewDirection.VERTICAL
|
||||
if (canTransmit) {
|
||||
this.transmitEvent(event, cc.Node.EventType.TOUCH_MOVE)
|
||||
event.stopPropagation()
|
||||
return
|
||||
}
|
||||
}
|
||||
this.prevLocation = event.touch.getPreviousLocation()
|
||||
this.location = event.touch.getLocation()
|
||||
super["_onTouchMoved"](event, captureListeners)
|
||||
if (this.pullRefresh) {
|
||||
let outOfBoundary = this["_getHowMuchOutOfBoundary"]()
|
||||
let offset = this.vertical ? outOfBoundary.y : -outOfBoundary.x
|
||||
if (offset > 0 && !this.isLockHeader && !this.isLockFooter) {
|
||||
this.headerProgress = offset < EPSILON ? 0 : offset / this.headerOutOffset
|
||||
this.isMoveHeader = this.headerProgress >= this.headerMultiple
|
||||
cc.Component.EventHandler.emitEvents(this.headerEvents, this, { action: false, progress: this.headerProgress, stage: this.isMoveHeader ? "wait" : "touch" })
|
||||
cc.Component.EventHandler.emitEvents(this.footerEvents, this, { action: false, progress: 0, stage: "release" })
|
||||
} else if (offset < 0 && !this.isLockHeader && !this.isLockFooter) {
|
||||
this.footerProgress = -offset < EPSILON ? 0 : -offset / this.footerOutOffset
|
||||
this.isMoveFooter = this.footerProgress >= this.footerMultiple
|
||||
cc.Component.EventHandler.emitEvents(this.footerEvents, this, { action: false, progress: this.footerProgress, stage: this.isMoveFooter ? "wait" : "touch" })
|
||||
cc.Component.EventHandler.emitEvents(this.headerEvents, this, { action: false, progress: 0, stage: "release" })
|
||||
} else if (offset == 0 && !this.isLockHeader && !this.isLockFooter) {
|
||||
this.clearProgress()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected _onTouchEnded(event: cc.Event.EventTouch, captureListeners: any) {
|
||||
this.isCallSoonFinish = false
|
||||
this.isCustomScroll = false
|
||||
if (!this.canTouchMove) return
|
||||
if (this.layout.isPageView) {
|
||||
_tempVec2 = event.getLocation()
|
||||
// cc.Vec2.set(this._touchEndPosition, _tempVec2.x, _tempVec2.y)
|
||||
this._touchEndPosition = cc.v2(_tempVec2.x, _tempVec2.y)
|
||||
}
|
||||
super["_onTouchEnded"](event, captureListeners)
|
||||
if (this.isTransmitEvent) {
|
||||
this.transmitEvent(event, cc.Node.EventType.TOUCH_END)
|
||||
}
|
||||
}
|
||||
protected _onTouchCancelled(event: cc.Event.EventTouch, captureListeners: any) {
|
||||
this.isCallSoonFinish = false
|
||||
this.isCustomScroll = false
|
||||
if (!this.canTouchMove) return
|
||||
if (this.layout.isPageView) {
|
||||
_tempVec2 = event.getLocation()
|
||||
// cc.Vec2.set(this._touchEndPosition, _tempVec2.x, _tempVec2.y)
|
||||
this._touchEndPosition = cc.v2(_tempVec2.x, _tempVec2.y)
|
||||
}
|
||||
if (this.isTransmitEvent) {
|
||||
this.transmitEvent(event, cc.Node.EventType.TOUCH_CANCEL)
|
||||
}
|
||||
super["_onTouchCancelled"](event, captureListeners)
|
||||
}
|
||||
scrollToAny(moveDelta: cc.Vec2, timeInSecond?: number, attenuated: boolean = true) {
|
||||
this.isCustomScroll = true
|
||||
if (timeInSecond) {
|
||||
this._startAutoScroll(moveDelta, timeInSecond, attenuated, true)
|
||||
} else {
|
||||
this["_moveContent"](moveDelta)
|
||||
}
|
||||
}
|
||||
release() {
|
||||
this.isMoveHeader = false
|
||||
this.isMoveFooter = false
|
||||
if (this.isLockHeader || this.isLockFooter) {
|
||||
this.vertical && this.isLockHeader && (this["_topBoundary"] += this.headerOutOffset)
|
||||
this.vertical && this.isLockFooter && (this["_bottomBoundary"] -= this.footerOutOffset)
|
||||
this.horizontal && this.isLockHeader && (this["_leftBoundary"] -= this.headerOutOffset)
|
||||
this.horizontal && this.isLockFooter && (this["_rightBoundary"] += this.footerOutOffset)
|
||||
this.clearProgress()
|
||||
this.layout["onPositionChanged"]()
|
||||
this.isLockHeader = false
|
||||
this.isLockFooter = false
|
||||
this.startAutoScroll()
|
||||
}
|
||||
}
|
||||
startAutoScroll() {
|
||||
this["_autoScrolling"] = true
|
||||
this["_outOfBoundaryAmountDirty"] = true
|
||||
}
|
||||
protected _startAutoScroll(deltaMove: any, timeInSecond: any, attenuated: any, flag: boolean = false) {
|
||||
if (this.pullRefresh) { // 如果没有刷新/加载的监听者 则不计算
|
||||
if (this.isMoveHeader && !this.isLockHeader) {
|
||||
if (this.vertical) {
|
||||
this["_topBoundary"] -= this.headerOutOffset
|
||||
deltaMove.y -= this.headerOutOffset
|
||||
}
|
||||
if (this.horizontal) {
|
||||
this["_leftBoundary"] += this.headerOutOffset
|
||||
deltaMove.x += this.headerOutOffset
|
||||
}
|
||||
this.isLockHeader = true
|
||||
cc.Component.EventHandler.emitEvents(this.headerEvents, this, { action: true, progress: this.headerProgress, stage: 'lock' })
|
||||
} else if (this.isMoveFooter && !this.isLockFooter) {
|
||||
if (this.vertical) {
|
||||
this["_bottomBoundary"] += this.footerOutOffset
|
||||
deltaMove.y += this.footerOutOffset
|
||||
}
|
||||
if (this.horizontal) {
|
||||
this["_rightBoundary"] -= this.footerOutOffset
|
||||
deltaMove.x -= this.footerOutOffset
|
||||
}
|
||||
this.isLockFooter = true
|
||||
cc.Component.EventHandler.emitEvents(this.footerEvents, this, { action: true, progress: this.footerProgress, stage: 'lock' })
|
||||
}
|
||||
}
|
||||
|
||||
super["_startAutoScroll"](deltaMove, timeInSecond, attenuated)
|
||||
if (!flag && this.layout.autoCenter) {
|
||||
const touchMoveVelocity = this["_calculateTouchMoveVelocity"]()
|
||||
if (!this.isQuicklyScrollable(touchMoveVelocity)) {
|
||||
this.soonFinish()
|
||||
}
|
||||
}
|
||||
}
|
||||
protected _updateScrollBar(outOfBoundary: any) {
|
||||
super["_updateScrollBar"](cc.v2(outOfBoundary.x, outOfBoundary.y))
|
||||
if (this["_autoScrollBraking"]) return // 自动回弹时不计算 (非手动)
|
||||
if (!this["_autoScrolling"]) return // 非自动滚动时不计算
|
||||
if (!this.pullRefresh) return
|
||||
let offset = this.vertical ? outOfBoundary.y : -outOfBoundary.x
|
||||
if (offset > 0) { // 下滑
|
||||
let progress = offset < EPSILON ? 0 : offset / this.headerOutOffset //根据参数 headerOutOffset 计算当前下滑的办百分比
|
||||
if (this.isLockHeader) {
|
||||
this.headerProgress = this.headerProgress == 1 ? this.headerProgress : Math.max(progress, 1)
|
||||
cc.Component.EventHandler.emitEvents(this.headerEvents, this, { action: false, progress: this.headerProgress, stage: "lock" })
|
||||
} else {
|
||||
this.headerProgress = progress < this.headerProgress ? progress : this.headerProgress
|
||||
cc.Component.EventHandler.emitEvents(this.headerEvents, this, { action: false, progress: this.headerProgress, stage: "release" })
|
||||
}
|
||||
} else if (offset < 0) {
|
||||
let progress = -offset < EPSILON ? 0 : -offset / this.footerOutOffset //根据参数 footerOutOffset 计算当前下滑的办百分比
|
||||
if (this.isLockFooter) {
|
||||
this.footerProgress = this.footerProgress == 1 ? this.footerProgress : Math.max(progress, 1)
|
||||
cc.Component.EventHandler.emitEvents(this.footerEvents, this, { action: false, progress: this.footerProgress, stage: "lock" })
|
||||
} else {
|
||||
this.footerProgress = progress < this.footerProgress ? progress : this.footerProgress
|
||||
cc.Component.EventHandler.emitEvents(this.footerEvents, this, { action: false, progress: this.footerProgress, stage: "release" })
|
||||
}
|
||||
} else if (offset == 0) {
|
||||
// 正常滑动时 如果没有锁定头和尾时 释放所有进度
|
||||
if (!this.isLockHeader && !this.isLockFooter) {
|
||||
this.clearProgress()
|
||||
}
|
||||
}
|
||||
}
|
||||
private clearProgress() {
|
||||
cc.Component.EventHandler.emitEvents(this.headerEvents, this, { action: false, progress: 0, stage: "release" })
|
||||
cc.Component.EventHandler.emitEvents(this.footerEvents, this, { action: false, progress: 0, stage: "release" })
|
||||
}
|
||||
private dispatchPageTurningEvent() {
|
||||
if (this.layout["_lastPageIndex"] === this.layout["_currPageIndex"]) return
|
||||
this.layout["_lastPageIndex"] = this.layout["_currPageIndex"]
|
||||
cc.Component.EventHandler.emitEvents(this.layout.pageEvents, this, "page-turning")
|
||||
this.node.emit("page-turning", this)
|
||||
}
|
||||
|
||||
protected _handleReleaseLogic(touch: any) {
|
||||
if (this.layout.isPageView) {
|
||||
this._autoScrollToPage();
|
||||
if (this["_scrolling"]) {
|
||||
this["_scrolling"] = false;
|
||||
if (!this["_autoScrolling"]) {
|
||||
this["_dispatchEvent"](cc.ScrollView.EventType.SCROLL_ENDED);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super["_handleReleaseLogic"](touch)
|
||||
}
|
||||
|
||||
}
|
||||
protected _autoScrollToPage() {
|
||||
const bounceBackStarted = this["_startBounceBackIfNeeded"]();
|
||||
if (bounceBackStarted) {
|
||||
const bounceBackAmount = this["_getHowMuchOutOfBoundary"]()
|
||||
this["_clampDelta"](bounceBackAmount)
|
||||
if (bounceBackAmount.x > 0 || bounceBackAmount.y < 0) {
|
||||
if (this.layout.horizontal) {
|
||||
if (this.layout.horizontalAxisDirection == SuperLayout.HorizontalAxisDirection.LEFT_TO_RIGHT) {
|
||||
this.layout["_currPageIndex"] = this.layout.itemTotal === 0 ? 0 : this.layout.itemTotal - 1
|
||||
} else {
|
||||
this.layout["_currPageIndex"] = 0
|
||||
}
|
||||
} else {
|
||||
if (this.layout.verticalAxisDirection == SuperLayout.VerticalAxisDirection.TOP_TO_BOTTOM) {
|
||||
this.layout["_currPageIndex"] = this.layout.itemTotal === 0 ? 0 : this.layout.itemTotal - 1
|
||||
} else {
|
||||
this.layout["_currPageIndex"] = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bounceBackAmount.x < 0 || bounceBackAmount.y > 0) {
|
||||
if (this.layout.horizontal) {
|
||||
if (this.layout.horizontalAxisDirection == SuperLayout.HorizontalAxisDirection.LEFT_TO_RIGHT) {
|
||||
this.layout["_currPageIndex"] = 0
|
||||
} else {
|
||||
this.layout["_currPageIndex"] = this.layout.itemTotal === 0 ? 0 : this.layout.itemTotal - 1
|
||||
}
|
||||
} else {
|
||||
if (this.layout.verticalAxisDirection == SuperLayout.VerticalAxisDirection.TOP_TO_BOTTOM) {
|
||||
this.layout["_currPageIndex"] = 0
|
||||
} else {
|
||||
this.layout["_currPageIndex"] = this.layout.itemTotal === 0 ? 0 : this.layout.itemTotal - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.layout.indicator) {
|
||||
this.layout.indicator["_changedState"]()
|
||||
}
|
||||
} else {
|
||||
const moveOffset = new cc.Vec2()
|
||||
// cc.Vec2.subtract(moveOffset, this._touchBeganPosition, this._touchEndPosition)
|
||||
moveOffset.x = this._touchBeganPosition.x - this._touchEndPosition.x
|
||||
moveOffset.y = this._touchBeganPosition.y - this._touchEndPosition.y
|
||||
|
||||
|
||||
const index = this.layout["_currPageIndex"]
|
||||
var nextIndex = index + this.getDragDirection(moveOffset)
|
||||
var timeInSecond = this.layout.pageTurningSpeed * Math.abs(index - nextIndex)
|
||||
if (this.layout.footerLoop) {
|
||||
if (nextIndex >= this.layout.itemTotal) {
|
||||
nextIndex = 0
|
||||
}
|
||||
}
|
||||
if (this.layout.headerLoop) {
|
||||
if (nextIndex < 0) {
|
||||
nextIndex = this.layout.itemTotal - 1
|
||||
}
|
||||
}
|
||||
const count = this.layout.itemTotal
|
||||
if (nextIndex < count) {
|
||||
if (this.isScrollable(moveOffset, index, nextIndex)) {
|
||||
this.scrollToPage(nextIndex, timeInSecond)
|
||||
return;
|
||||
} else {
|
||||
const touchMoveVelocity = this["_calculateTouchMoveVelocity"]()
|
||||
if (this.isQuicklyScrollable(touchMoveVelocity)) {
|
||||
this.scrollToPage(nextIndex, timeInSecond)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.scrollToPage(index, timeInSecond)
|
||||
}
|
||||
}
|
||||
savePageIndex(idx: number) {
|
||||
if (idx < 0 || idx >= this.layout.itemTotal) {
|
||||
return false
|
||||
}
|
||||
this.layout["_currPageIndex"] = idx
|
||||
if (this.layout.indicator) {
|
||||
this.layout.indicator["_changedState"]()
|
||||
}
|
||||
return true
|
||||
}
|
||||
protected scrollToPage(idx: number, timeInSecond = 0.3) {
|
||||
if (idx < 0 || idx >= this.layout.itemTotal) {
|
||||
return
|
||||
}
|
||||
if (this.savePageIndex(idx)) {
|
||||
this.layout.scrollToIndex(idx, timeInSecond)
|
||||
}
|
||||
}
|
||||
// 快速滑动
|
||||
protected isQuicklyScrollable(touchMoveVelocity: cc.Vec3) {
|
||||
if (this.horizontal) {
|
||||
if (Math.abs(touchMoveVelocity.x) > this.layout.autoPageTurningThreshold) {
|
||||
return true;
|
||||
}
|
||||
} else if (this.vertical) {
|
||||
if (Math.abs(touchMoveVelocity.y) > this.layout.autoPageTurningThreshold) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
protected getDragDirection(moveOffset: cc.Vec2) {
|
||||
if (this.horizontal) {
|
||||
if (moveOffset.x === 0) {
|
||||
return 0;
|
||||
}
|
||||
if (this.layout.horizontalAxisDirection == SuperLayout.HorizontalAxisDirection.LEFT_TO_RIGHT) {
|
||||
return (moveOffset.x > 0 ? this.layout.groupItemTotal : -this.layout.groupItemTotal);
|
||||
} else {
|
||||
return (moveOffset.x < 0 ? this.layout.groupItemTotal : -this.layout.groupItemTotal);
|
||||
}
|
||||
} else {
|
||||
// 由于滚动 Y 轴的原点在在右上角所以应该是小于 0
|
||||
if (moveOffset.y === 0) {
|
||||
return 0;
|
||||
}
|
||||
if (this.layout.verticalAxisDirection == SuperLayout.VerticalAxisDirection.TOP_TO_BOTTOM) {
|
||||
return (moveOffset.y < 0 ? this.layout.groupItemTotal : -this.layout.groupItemTotal);
|
||||
} else {
|
||||
return (moveOffset.y > 0 ? this.layout.groupItemTotal : -this.layout.groupItemTotal);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 是否超过自动滚动临界值
|
||||
protected isScrollable(offset: cc.Vec2, index: number, nextIndex: number) {
|
||||
const viewTrans = this.view
|
||||
if (!viewTrans) {
|
||||
return false
|
||||
}
|
||||
if (this.horizontal) {
|
||||
return Math.abs(offset.x) >= viewTrans.width * this.layout.scrollThreshold
|
||||
} else if (this.vertical) {
|
||||
return Math.abs(offset.y) >= viewTrans.height * this.layout.scrollThreshold
|
||||
}
|
||||
return false;
|
||||
}
|
||||
protected transmitEvent(event: any, eventType: string) {
|
||||
var e = new cc.Event.EventTouch(event.getTouches(), event.bubbles)
|
||||
e.type = eventType
|
||||
e.touch = event.touch
|
||||
let target: any = event.target
|
||||
target.parent.dispatchEvent(e)
|
||||
}
|
||||
private soonFinish() {
|
||||
this.isCallSoonFinish = true
|
||||
this.layout["soonFinish"]()
|
||||
}
|
||||
protected _processAutoScrolling(dt: number) {
|
||||
let isAutoScrollBrake = this["_isNecessaryAutoScrollBrake"]();
|
||||
let brakingFactor = isAutoScrollBrake ? OUT_OF_BOUNDARY_BREAKING_FACTOR : 1;
|
||||
this["_autoScrollAccumulatedTime"] += dt * (1 / brakingFactor);
|
||||
|
||||
let percentage = Math.min(1, this["_autoScrollAccumulatedTime"] / this["_autoScrollTotalTime"]);
|
||||
if (this["_autoScrollAttenuate"]) {
|
||||
percentage = quintEaseOut(percentage);
|
||||
}
|
||||
|
||||
let newPosition = this["_autoScrollStartPosition"].add(this["_autoScrollTargetDelta"].mul(percentage));
|
||||
let reachedEnd = Math.abs(percentage - 1) <= EPSILON;
|
||||
|
||||
let fireEvent = Math.abs(percentage - 1) <= this["getScrollEndedEventTiming"]();
|
||||
if (fireEvent && !this["_isScrollEndedWithThresholdEventFired"]) {
|
||||
this["_dispatchEvent"]('scroll-ended-with-threshold');
|
||||
this["_isScrollEndedWithThresholdEventFired"] = true;
|
||||
}
|
||||
|
||||
if (this.elastic) {
|
||||
let brakeOffsetPosition = newPosition.sub(this["_autoScrollBrakingStartPosition"]);
|
||||
if (isAutoScrollBrake) {
|
||||
brakeOffsetPosition = brakeOffsetPosition.mul(brakingFactor);
|
||||
}
|
||||
newPosition = this["_autoScrollBrakingStartPosition"].add(brakeOffsetPosition);
|
||||
} else {
|
||||
let moveDelta = newPosition.sub(this.getContentPosition());
|
||||
let outOfBoundary = this["_getHowMuchOutOfBoundary"](moveDelta);
|
||||
if (!outOfBoundary.fuzzyEquals(cc.v2(0, 0), EPSILON)) {
|
||||
newPosition = newPosition.add(outOfBoundary);
|
||||
reachedEnd = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (reachedEnd) {
|
||||
this["_autoScrolling"] = false;
|
||||
}
|
||||
if (this.layout.autoCenter && !this.isCallSoonFinish && !this.isCustomScroll) {
|
||||
if (this["_autoScrollTotalTime"] < 2 || percentage >= 0.8) {
|
||||
this.soonFinish()
|
||||
}
|
||||
}
|
||||
let deltaMove = newPosition.sub(this.getContentPosition());
|
||||
this["_moveContent"](this["_clampDelta"](deltaMove), reachedEnd);
|
||||
this["_dispatchEvent"]('scrolling');
|
||||
if (!this["_autoScrolling"]) {
|
||||
this["_isBouncing"] = false;
|
||||
this["_scrolling"] = false;
|
||||
this["_dispatchEvent"]('scroll-ended');
|
||||
}
|
||||
}
|
||||
}
|
9
assets/core/super-scrollview.ts.meta
Normal file
9
assets/core/super-scrollview.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "4391f900-5b57-435c-880d-8adb79b43a29",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
12
assets/migration.meta
Normal file
12
assets/migration.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "839d2650-34b1-4207-9b4c-48cdcb7c2d79",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
13
assets/migration/use_reversed_rotateTo.js
Normal file
13
assets/migration/use_reversed_rotateTo.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This script is automatically generated by Cocos Creator and is only used for projects compatible with v2.1.0/v2.1.1/v2.2.1/v2.2.2 versions.
|
||||
* You do not need to manually add this script in any other project.
|
||||
* If you don't use cc.Action in your project, you can delete this script directly.
|
||||
* If your project is hosted in VCS such as git, submit this script together.
|
||||
*
|
||||
* 此脚本由 Cocos Creator 自动生成,仅用于兼容 v2.1.0/v2.1.1/v2.2.1/v2.2.2 版本的工程,
|
||||
* 你无需在任何其它项目中手动添加此脚本。
|
||||
* 如果你的项目中没用到 Action,可直接删除该脚本。
|
||||
* 如果你的项目有托管于 git 等版本库,请将此脚本一并上传。
|
||||
*/
|
||||
|
||||
cc.RotateTo._reverse = true;
|
9
assets/migration/use_reversed_rotateTo.js.meta
Normal file
9
assets/migration/use_reversed_rotateTo.js.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "d1771dfd-a878-412a-9449-f3f76bf5ba3b",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
12
assets/prefabs.meta
Normal file
12
assets/prefabs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "3da26f6a-eebd-4e2a-86ec-c849878c84de",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
1280
assets/prefabs/horizontal-item.prefab
Normal file
1280
assets/prefabs/horizontal-item.prefab
Normal file
File diff suppressed because it is too large
Load Diff
8
assets/prefabs/horizontal-item.prefab.meta
Normal file
8
assets/prefabs/horizontal-item.prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "f459674e-615c-4763-941d-457f819cc65b",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
739
assets/prefabs/horizontal-page-scrollview.prefab
Normal file
739
assets/prefabs/horizontal-page-scrollview.prefab
Normal file
@@ -0,0 +1,739 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "vertical-page-scrollview",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 20
|
||||
},
|
||||
{
|
||||
"__id__": 21
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 22
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 78,
|
||||
"g": 156,
|
||||
"b": 87,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1000,
|
||||
"height": 300
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "New Label",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 44.49,
|
||||
"height": 100.8
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
81.59399999999997,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "1",
|
||||
"_N$string": "1",
|
||||
"_fontSize": 80,
|
||||
"_lineHeight": 80,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 1,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 18.006000000000014,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "768c1320-b5ef-4213-90c4-2b996ae72549"
|
||||
},
|
||||
"fileId": "eaXC9r0j9G8rLR0iRT1dRT",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "subScrollview",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 17
|
||||
},
|
||||
{
|
||||
"__id__": 10
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 26,
|
||||
"g": 34,
|
||||
"b": 44,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 960,
|
||||
"height": 130
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-65,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "view",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 8
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 13
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 960,
|
||||
"height": 130
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "content",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 9
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 220,
|
||||
"height": 400
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 1
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
115.30999755859375,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "04016tZcPBKlocFc1/KuZe9",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"scrollView": {
|
||||
"__id__": 10
|
||||
},
|
||||
"view": {
|
||||
"__id__": 7
|
||||
},
|
||||
"prefab": {
|
||||
"__uuid__": "11a8e56c-c086-4003-8a6f-f777873abb7a"
|
||||
},
|
||||
"layoutType": 1,
|
||||
"indexVerticalAxisDirection": 0,
|
||||
"indexHorizontalAxisDirection": 0,
|
||||
"verticalAxisDirection": 0,
|
||||
"horizontalAxisDirection": 0,
|
||||
"groupItemTotal": 1,
|
||||
"multiple": 2,
|
||||
"paddingTop": 10,
|
||||
"paddingBottom": 10,
|
||||
"paddingLeft": 10,
|
||||
"paddingRight": 10,
|
||||
"spacingX": 10,
|
||||
"spacingY": 10,
|
||||
"affectedByScale": false,
|
||||
"isPageView": false,
|
||||
"pageTurningSpeed": 0.3,
|
||||
"indicator": null,
|
||||
"scrollThreshold": 0.5,
|
||||
"autoPageTurningThreshold": 100,
|
||||
"pageEvents": [],
|
||||
"autoCenter": false,
|
||||
"centerTime": 1,
|
||||
"centerNode": null,
|
||||
"centerAnchor": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"headerLoop": false,
|
||||
"footerLoop": false,
|
||||
"refreshItemEvents": [
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "4391fkAW1dDXIgNitt5tDop",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"horizontal": false,
|
||||
"vertical": true,
|
||||
"inertia": true,
|
||||
"brake": 0.5,
|
||||
"elastic": true,
|
||||
"bounceDuration": 0.5,
|
||||
"scrollEvents": [],
|
||||
"cancelInnerEvents": true,
|
||||
"_N$content": {
|
||||
"__id__": 8
|
||||
},
|
||||
"content": {
|
||||
"__id__": 8
|
||||
},
|
||||
"isTransmitEvent": true,
|
||||
"pullRefresh": false,
|
||||
"headerOutOffset": 200,
|
||||
"headerMultiple": 2,
|
||||
"footerOutOffset": 200,
|
||||
"footerMultiple": 2,
|
||||
"headerEvents": [],
|
||||
"footerEvents": [],
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ClickEvent",
|
||||
"target": {
|
||||
"__id__": 6
|
||||
},
|
||||
"component": "",
|
||||
"_componentId": "489837NA9hAUrQkbUHZzoWs",
|
||||
"handler": "onRefreshEvent",
|
||||
"customEventData": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "768c1320-b5ef-4213-90c4-2b996ae72549"
|
||||
},
|
||||
"fileId": "a41WKuFZxAP7ttIwS23Lk/",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Mask",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_spriteFrame": null,
|
||||
"_type": 0,
|
||||
"_segments": 64,
|
||||
"_N$alphaThreshold": 0,
|
||||
"_N$inverted": false,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 240,
|
||||
"_originalHeight": 250,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "768c1320-b5ef-4213-90c4-2b996ae72549"
|
||||
},
|
||||
"fileId": "bfVmpc7x1Ki4Z7/5i+4MrV",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "9bbda31e-ad49-43c9-aaf2-f7d9896bac69"
|
||||
},
|
||||
"_type": 1,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 20,
|
||||
"_right": 20,
|
||||
"_top": 150,
|
||||
"_bottom": 20,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 240,
|
||||
"_originalHeight": 250,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "489837NA9hAUrQkbUHZzoWs",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"layout": {
|
||||
"__id__": 9
|
||||
},
|
||||
"input": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "768c1320-b5ef-4213-90c4-2b996ae72549"
|
||||
},
|
||||
"fileId": "31zaKVpltMaKKP8xMpUx+M",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "f9296kejYBFypS3gzSKxDee",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"label": {
|
||||
"__id__": 3
|
||||
},
|
||||
"input": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "768c1320-b5ef-4213-90c4-2b996ae72549"
|
||||
},
|
||||
"fileId": "46kqEzD45KPrZdMSTF6DIB",
|
||||
"sync": false
|
||||
}
|
||||
]
|
8
assets/prefabs/horizontal-page-scrollview.prefab.meta
Normal file
8
assets/prefabs/horizontal-page-scrollview.prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "768c1320-b5ef-4213-90c4-2b996ae72549",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
1269
assets/prefabs/vertical-item.prefab
Normal file
1269
assets/prefabs/vertical-item.prefab
Normal file
File diff suppressed because it is too large
Load Diff
8
assets/prefabs/vertical-item.prefab.meta
Normal file
8
assets/prefabs/vertical-item.prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "11a8e56c-c086-4003-8a6f-f777873abb7a",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
709
assets/prefabs/vertical-page-scrollview.prefab
Normal file
709
assets/prefabs/vertical-page-scrollview.prefab
Normal file
@@ -0,0 +1,709 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "vertical-page-scrollview",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 19
|
||||
},
|
||||
{
|
||||
"__id__": 20
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 21
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 78,
|
||||
"g": 156,
|
||||
"b": 87,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 200,
|
||||
"height": 600
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "New Label",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 44.49,
|
||||
"height": 100.8
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
228.741,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "1",
|
||||
"_N$string": "1",
|
||||
"_fontSize": 80,
|
||||
"_lineHeight": 80,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "421d309b-8377-4ae4-9617-16c4de484f62"
|
||||
},
|
||||
"fileId": "eaXC9r0j9G8rLR0iRT1dRT",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "subScrollview",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 15
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 9
|
||||
},
|
||||
{
|
||||
"__id__": 17
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 18
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 26,
|
||||
"g": 34,
|
||||
"b": 44,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 160,
|
||||
"height": 430
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-65,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "subView",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 12
|
||||
},
|
||||
{
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 160,
|
||||
"height": 430
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "subContent",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 8
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 2,
|
||||
"height": 2
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 1
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "04016tZcPBKlocFc1/KuZe9",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_enabled": true,
|
||||
"scrollView": {
|
||||
"__id__": 9
|
||||
},
|
||||
"view": {
|
||||
"__id__": 6
|
||||
},
|
||||
"prefab": {
|
||||
"__uuid__": "f459674e-615c-4763-941d-457f819cc65b"
|
||||
},
|
||||
"layoutType": 0,
|
||||
"indexVerticalAxisDirection": 0,
|
||||
"indexHorizontalAxisDirection": 0,
|
||||
"verticalAxisDirection": 0,
|
||||
"horizontalAxisDirection": 0,
|
||||
"groupItemTotal": 1,
|
||||
"multiple": 2,
|
||||
"paddingTop": 10,
|
||||
"paddingBottom": 10,
|
||||
"paddingLeft": 10,
|
||||
"paddingRight": 10,
|
||||
"spacingX": 10,
|
||||
"spacingY": 10,
|
||||
"affectedByScale": false,
|
||||
"isPageView": false,
|
||||
"pageTurningSpeed": 0.3,
|
||||
"indicator": null,
|
||||
"scrollThreshold": 0.5,
|
||||
"autoPageTurningThreshold": 100,
|
||||
"pageEvents": [],
|
||||
"autoCenter": false,
|
||||
"centerTime": 1,
|
||||
"centerNode": null,
|
||||
"centerAnchor": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"headerLoop": false,
|
||||
"footerLoop": false,
|
||||
"refreshItemEvents": [
|
||||
{
|
||||
"__id__": 10
|
||||
}
|
||||
],
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "4391fkAW1dDXIgNitt5tDop",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"horizontal": true,
|
||||
"vertical": false,
|
||||
"inertia": true,
|
||||
"brake": 0.5,
|
||||
"elastic": true,
|
||||
"bounceDuration": 0.5,
|
||||
"scrollEvents": [],
|
||||
"cancelInnerEvents": true,
|
||||
"_N$content": {
|
||||
"__id__": 7
|
||||
},
|
||||
"content": {
|
||||
"__id__": 7
|
||||
},
|
||||
"isTransmitEvent": true,
|
||||
"pullRefresh": false,
|
||||
"headerOutOffset": 200,
|
||||
"headerMultiple": 2,
|
||||
"footerOutOffset": 200,
|
||||
"footerMultiple": 2,
|
||||
"headerEvents": [],
|
||||
"footerEvents": [],
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ClickEvent",
|
||||
"target": {
|
||||
"__id__": 5
|
||||
},
|
||||
"component": "",
|
||||
"_componentId": "489837NA9hAUrQkbUHZzoWs",
|
||||
"handler": "onRefreshEvent",
|
||||
"customEventData": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "421d309b-8377-4ae4-9617-16c4de484f62"
|
||||
},
|
||||
"fileId": "a41WKuFZxAP7ttIwS23Lk/",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Mask",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_spriteFrame": null,
|
||||
"_type": 0,
|
||||
"_segments": 64,
|
||||
"_N$alphaThreshold": 0,
|
||||
"_N$inverted": false,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 2,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 240,
|
||||
"_originalHeight": 250,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "421d309b-8377-4ae4-9617-16c4de484f62"
|
||||
},
|
||||
"fileId": "bfVmpc7x1Ki4Z7/5i+4MrV",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "9bbda31e-ad49-43c9-aaf2-f7d9896bac69"
|
||||
},
|
||||
"_type": 1,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 2,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 20,
|
||||
"_right": 20,
|
||||
"_top": 150,
|
||||
"_bottom": 20,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 240,
|
||||
"_originalHeight": 250,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "489837NA9hAUrQkbUHZzoWs",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"layout": {
|
||||
"__id__": 8
|
||||
},
|
||||
"input": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "421d309b-8377-4ae4-9617-16c4de484f62"
|
||||
},
|
||||
"fileId": "31zaKVpltMaKKP8xMpUx+M",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "f9296kejYBFypS3gzSKxDee",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"label": {
|
||||
"__id__": 3
|
||||
},
|
||||
"input": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "421d309b-8377-4ae4-9617-16c4de484f62"
|
||||
},
|
||||
"fileId": "46kqEzD45KPrZdMSTF6DIB",
|
||||
"sync": false
|
||||
}
|
||||
]
|
8
assets/prefabs/vertical-page-scrollview.prefab.meta
Normal file
8
assets/prefabs/vertical-page-scrollview.prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "421d309b-8377-4ae4-9617-16c4de484f62",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
245
assets/prefabs/vertical-page.prefab
Normal file
245
assets/prefabs/vertical-page.prefab
Normal file
@@ -0,0 +1,245 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "vertical-page",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 78,
|
||||
"g": 156,
|
||||
"b": 87,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 600,
|
||||
"height": 600
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "New Label",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 44.49,
|
||||
"height": 100.8
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "1",
|
||||
"_N$string": "1",
|
||||
"_fontSize": 80,
|
||||
"_lineHeight": 80,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5e0d1dc4-f7f0-4fab-85d5-c83bfdf51352"
|
||||
},
|
||||
"fileId": "eaXC9r0j9G8rLR0iRT1dRT",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "f9296kejYBFypS3gzSKxDee",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"label": {
|
||||
"__id__": 3
|
||||
},
|
||||
"input": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5e0d1dc4-f7f0-4fab-85d5-c83bfdf51352"
|
||||
},
|
||||
"fileId": "46kqEzD45KPrZdMSTF6DIB",
|
||||
"sync": false
|
||||
}
|
||||
]
|
8
assets/prefabs/vertical-page.prefab.meta
Normal file
8
assets/prefabs/vertical-page.prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "5e0d1dc4-f7f0-4fab-85d5-c83bfdf51352",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
12
assets/scenes.meta
Normal file
12
assets/scenes.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "ca97363d-38a9-42ee-9f3a-28638d9dbaf5",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
2886
assets/scenes/horizontal-grid.fire
Normal file
2886
assets/scenes/horizontal-grid.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/horizontal-grid.fire.meta
Normal file
7
assets/scenes/horizontal-grid.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "ff900157-35a1-4346-bcae-16a05ea86823",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
3006
assets/scenes/horizontal-page-scrollview.fire
Normal file
3006
assets/scenes/horizontal-page-scrollview.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/horizontal-page-scrollview.fire.meta
Normal file
7
assets/scenes/horizontal-page-scrollview.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "68847689-a5ef-4145-9a1f-a110a5dbba28",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
2886
assets/scenes/horizontal.fire
Normal file
2886
assets/scenes/horizontal.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/horizontal.fire.meta
Normal file
7
assets/scenes/horizontal.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "9aa6aa99-d8d9-44bc-9090-e62f048bf567",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
3237
assets/scenes/vertical-center.fire
Normal file
3237
assets/scenes/vertical-center.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-center.fire.meta
Normal file
7
assets/scenes/vertical-center.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "e112e213-c2bc-4341-a8a6-4021f28f1a92",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
2886
assets/scenes/vertical-grid.fire
Normal file
2886
assets/scenes/vertical-grid.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-grid.fire.meta
Normal file
7
assets/scenes/vertical-grid.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "ce6a09ac-91d3-4172-ad20-ad284aa33e02",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
2886
assets/scenes/vertical-loop-grid.fire
Normal file
2886
assets/scenes/vertical-loop-grid.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-loop-grid.fire.meta
Normal file
7
assets/scenes/vertical-loop-grid.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "8f9f1504-873c-453a-81af-b72557bdd719",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
2886
assets/scenes/vertical-loop.fire
Normal file
2886
assets/scenes/vertical-loop.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-loop.fire.meta
Normal file
7
assets/scenes/vertical-loop.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "2673a9fd-3342-4ac5-915b-94928089dc52",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
3006
assets/scenes/vertical-page-scrollview.fire
Normal file
3006
assets/scenes/vertical-page-scrollview.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-page-scrollview.fire.meta
Normal file
7
assets/scenes/vertical-page-scrollview.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "31e0da9a-3b52-4d75-a1d4-312545fd75fc",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
3006
assets/scenes/vertical-page.fire
Normal file
3006
assets/scenes/vertical-page.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-page.fire.meta
Normal file
7
assets/scenes/vertical-page.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "ea6fb857-ad6e-466b-8ca2-8806c5b41545",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
3372
assets/scenes/vertical-refresh-load.fire
Normal file
3372
assets/scenes/vertical-refresh-load.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical-refresh-load.fire.meta
Normal file
7
assets/scenes/vertical-refresh-load.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "7008a974-b4a9-4a4f-ae07-535de560df1c",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
2886
assets/scenes/vertical.fire
Normal file
2886
assets/scenes/vertical.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/scenes/vertical.fire.meta
Normal file
7
assets/scenes/vertical.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "2a115ee4-d334-41c8-86e3-dad6cb134f3f",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
12
assets/scripts.meta
Normal file
12
assets/scripts.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "58f5d54a-b531-4f81-b179-6b40bd7b2233",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/scripts/.DS_Store
vendored
Normal file
BIN
assets/scripts/.DS_Store
vendored
Normal file
Binary file not shown.
19
assets/scripts/auto-center.ts
Normal file
19
assets/scripts/auto-center.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
import Simple from './simple';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class AutoCenter extends Simple {
|
||||
@property(cc.Label) label: cc.Label = null
|
||||
@property key: string = ""
|
||||
start() {
|
||||
this.label.string = `当前中心锚点:${(this.layout.centerAnchor as any)[this.key]}`
|
||||
}
|
||||
onInputAnchor(event: cc.EditBox) {
|
||||
let anchor = Number(event.string)
|
||||
if (isNaN(anchor)) return
|
||||
(this.layout.centerAnchor as any)[this.key] = anchor
|
||||
this.layout.scrollToCenter()
|
||||
this.label.string = `当前中心锚点:${(this.layout.centerAnchor as any)[this.key]}`
|
||||
}
|
||||
}
|
9
assets/scripts/auto-center.ts.meta
Normal file
9
assets/scripts/auto-center.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "59a8d94e-6ce6-4056-b3b7-4bbfbd2d7f13",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
24
assets/scripts/baseItem.ts
Normal file
24
assets/scripts/baseItem.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class BaseItem extends cc.Component {
|
||||
@property(cc.Label) label: cc.Label = null
|
||||
@property(cc.EditBox) input: cc.EditBox = null
|
||||
private index: number
|
||||
private clickFunc: Function
|
||||
get transform() {
|
||||
return this.node
|
||||
}
|
||||
show(data: any, index: number, callback: Function) {
|
||||
this.index = index
|
||||
this.label.string = data.message
|
||||
this.clickFunc = callback
|
||||
}
|
||||
onClick() {
|
||||
this.clickFunc.call(this, this.index)
|
||||
}
|
||||
onInput() {
|
||||
|
||||
}
|
||||
}
|
9
assets/scripts/baseItem.ts.meta
Normal file
9
assets/scripts/baseItem.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "f929691e-8d80-45ca-94b7-83348ac4379e",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
42
assets/scripts/baseMain.ts
Normal file
42
assets/scripts/baseMain.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
import SuperLayout from '../core/super-layout';
|
||||
import BaseItem from './baseItem';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class BaseMain extends cc.Component {
|
||||
@property(SuperLayout) layout: SuperLayout = null
|
||||
@property(cc.EditBox) input: cc.EditBox = null
|
||||
protected datas: any[] = []
|
||||
|
||||
toHeader() {
|
||||
this.layout.scrollToHeader(1)
|
||||
}
|
||||
toFooter() {
|
||||
this.layout.scrollToFooter(1)
|
||||
}
|
||||
toIndex() {
|
||||
var index = Number(this.input.string)
|
||||
if (isNaN(index)) return
|
||||
this.layout.scrollToIndex(index, 1)
|
||||
}
|
||||
toBack() {
|
||||
cc.director.loadScene("main")
|
||||
}
|
||||
|
||||
onRefreshEvent(item: cc.Node, index: number) {
|
||||
item.getComponent(BaseItem).show(this.datas[index], index, this.onClickItem.bind(this))
|
||||
}
|
||||
onClickItem(index: number) {
|
||||
this.datas.splice(index, 1)
|
||||
this.layout.total(this.datas.length)
|
||||
}
|
||||
addItem(event: any, args: any) {
|
||||
let count = Number(args)
|
||||
if (isNaN(count)) return
|
||||
for (let i = 0; i < count; i++) {
|
||||
this.datas.push({ message: this.datas.length })
|
||||
}
|
||||
this.layout.total(this.datas.length)
|
||||
}
|
||||
}
|
9
assets/scripts/baseMain.ts.meta
Normal file
9
assets/scripts/baseMain.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "556e96b5-e975-4595-8541-e1ab590e163f",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
18
assets/scripts/horizontal.ts
Normal file
18
assets/scripts/horizontal.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import BaseItem from './baseItem';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Horizontal extends BaseItem {
|
||||
onLoad() {
|
||||
this.input.placeholder = this.transform.width.toString()
|
||||
}
|
||||
onInput() {
|
||||
let width = Number(this.input.string)
|
||||
if (isNaN(width)) return
|
||||
if (width < 100) {
|
||||
return
|
||||
}
|
||||
this.transform.setContentSize(new cc.Size(Number(this.input.string), this.transform.height))
|
||||
}
|
||||
}
|
9
assets/scripts/horizontal.ts.meta
Normal file
9
assets/scripts/horizontal.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "6c7ecf78-01a9-4555-b915-6c3253e68ce2",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
10
assets/scripts/main.ts
Normal file
10
assets/scripts/main.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Main extends cc.Component {
|
||||
|
||||
toScene(event:any,args:string){
|
||||
cc.director.loadScene(args)
|
||||
}
|
||||
}
|
9
assets/scripts/main.ts.meta
Normal file
9
assets/scripts/main.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "d349c267-15e9-4070-8d83-72c48d3a9550",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
26
assets/scripts/page.ts
Normal file
26
assets/scripts/page.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
import SuperLayout from '../core/super-layout';
|
||||
import BaseItem from './baseItem';
|
||||
import BaseMain from './baseMain';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Page extends BaseMain {
|
||||
start() {
|
||||
for (let i = 0; i < 8; i++) {
|
||||
this.datas.push({
|
||||
message: i
|
||||
})
|
||||
}
|
||||
this.layout.total(this.datas.length)
|
||||
}
|
||||
onRefreshEvent(item: cc.Node, index: number) {
|
||||
item.getComponent(BaseItem).show(this.datas[index], index, this.onClickItem.bind(this))
|
||||
}
|
||||
onClickItem() {
|
||||
}
|
||||
|
||||
onPageEvent(event: any) {
|
||||
console.error(this.layout.currPageIndex)
|
||||
}
|
||||
}
|
9
assets/scripts/page.ts.meta
Normal file
9
assets/scripts/page.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "4a48eb73-367c-4cea-a3b6-2470f795a1ff",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
93
assets/scripts/refresh-load.ts
Normal file
93
assets/scripts/refresh-load.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
|
||||
import BaseMain from './baseMain';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class RefreshLoad extends BaseMain {
|
||||
@property(cc.Node) header: cc.Node = null
|
||||
@property(cc.Node) footer: cc.Node = null
|
||||
onLoad() {
|
||||
this.header.setScale(new cc.Vec3(1, 0, 1))
|
||||
this.footer.setScale(new cc.Vec3(1, 0, 1))
|
||||
}
|
||||
|
||||
private headerTween: cc.Tween<cc.Node>
|
||||
private footerTween: cc.Tween<cc.Node>
|
||||
onHeader(scrollView: any, event: any) {
|
||||
if (event.progress > 2) {
|
||||
if (!(this.header as any)['playing']) {
|
||||
this.headerTween = new cc.Tween(this.header);
|
||||
this.headerTween.to(0.518, {
|
||||
scaleX: 1,
|
||||
scaleY: 1,
|
||||
}, {
|
||||
easing: "elasticOut"
|
||||
});
|
||||
this.headerTween.start();
|
||||
(this.header as any)['playing'] = true
|
||||
}
|
||||
} else {
|
||||
this.headerTween && this.headerTween.stop();
|
||||
(this.header as any)['playing'] = false
|
||||
this.header.setScale(new cc.Vec3(1, event.progress, 1))
|
||||
}
|
||||
|
||||
let label = this.header.getComponentInChildren(cc.Label)
|
||||
if (event.stage == "touch") {
|
||||
label.string = "↓ 继续下拉"
|
||||
}
|
||||
if (event.stage == "wait") {
|
||||
label.string = "↑ 松开刷新"
|
||||
}
|
||||
if (event.stage == "lock") {
|
||||
label.string = this.datas.length == 0 ? "没有数据" : "刷新中..."
|
||||
}
|
||||
if (event.stage == 'release') {
|
||||
label.string = ""
|
||||
}
|
||||
if (event.action) {
|
||||
this.scheduleOnce(() => this.layout.total(this.datas.length), 1)
|
||||
}
|
||||
}
|
||||
onFooter(scrollView: any, event: any) {
|
||||
if (event.progress > 2) {
|
||||
if (!(this.footer as any)['playing']) {
|
||||
this.footerTween = new cc.Tween(this.footer);
|
||||
this.footerTween.to(0.518, {
|
||||
scaleX: 1,
|
||||
scaleY: 1,
|
||||
}, {
|
||||
easing: "elasticOut"
|
||||
});
|
||||
this.footerTween.start();
|
||||
(this.footer as any)['playing'] = true
|
||||
}
|
||||
} else {
|
||||
this.footerTween && this.footerTween.stop();
|
||||
(this.footer as any)['playing'] = false
|
||||
this.footer.setScale(new cc.Vec3(1, event.progress, 1))
|
||||
}
|
||||
|
||||
let label = this.footer.getComponentInChildren(cc.Label)
|
||||
if (event.stage == "touch") {
|
||||
label.string = "↑ 继续上拉"
|
||||
}
|
||||
if (event.stage == "wait") {
|
||||
label.string = "↓ 松开加载"
|
||||
}
|
||||
if (event.stage == "lock") {
|
||||
label.string = "加载中..."
|
||||
}
|
||||
if (event.stage == 'release') {
|
||||
label.string = ""
|
||||
}
|
||||
if (event.action) {
|
||||
for (let i = 0; i < 60; i++) {
|
||||
this.datas.push({
|
||||
message: `${this.datas.length}`
|
||||
})
|
||||
}
|
||||
this.scheduleOnce(() => this.layout.total(this.datas.length), 1)
|
||||
}
|
||||
}
|
||||
}
|
9
assets/scripts/refresh-load.ts.meta
Normal file
9
assets/scripts/refresh-load.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "57b8308f-b748-416b-b117-41f8cb429157",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
13
assets/scripts/simple.ts
Normal file
13
assets/scripts/simple.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import BaseMain from './baseMain';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Simple extends BaseMain {
|
||||
async onLoad() {
|
||||
for (let i = 0; i < 200; i++) {
|
||||
this.datas.push({ message: i })
|
||||
}
|
||||
await this.layout.total(this.datas.length)
|
||||
}
|
||||
}
|
9
assets/scripts/simple.ts.meta
Normal file
9
assets/scripts/simple.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "48983ecd-03d8-4052-b424-6d41d9ce85ac",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
19
assets/scripts/vertical.ts
Normal file
19
assets/scripts/vertical.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
import BaseItem from './baseItem';
|
||||
const { ccclass, property } = cc._decorator;
|
||||
@ccclass
|
||||
export default class Vertical extends BaseItem {
|
||||
onLoad() {
|
||||
this.input.placeholder = this.transform.height.toString()
|
||||
}
|
||||
onInput() {
|
||||
let height = Number(this.input.string)
|
||||
if (isNaN(height)) return
|
||||
if (height < 100) {
|
||||
return
|
||||
}
|
||||
|
||||
this.transform.setContentSize(new cc.Size(this.transform.width, height))
|
||||
}
|
||||
}
|
||||
|
9
assets/scripts/vertical.ts.meta
Normal file
9
assets/scripts/vertical.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "a33f01f3-a0ca-430d-87ba-9a95e13fedf1",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
1404
assets/super-layout.ts
Normal file
1404
assets/super-layout.ts
Normal file
File diff suppressed because it is too large
Load Diff
9
assets/super-layout.ts.meta
Normal file
9
assets/super-layout.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "33f37499-53bc-4547-9345-35fd06c58a63",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
8
project.json
Normal file
8
project.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"engine": "cocos-creator-js",
|
||||
"packages": "packages",
|
||||
"name": "super-scrollview2.4",
|
||||
"id": "e2d5cc5c-e751-4433-8b34-5a4c7caed6da",
|
||||
"version": "2.4.4",
|
||||
"isNew": false
|
||||
}
|
19
tsconfig.json
Normal file
19
tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es2015", "es2017", "dom" ],
|
||||
"target": "es5",
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "temp/vscode-dist",
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"library",
|
||||
"local",
|
||||
"temp",
|
||||
"build",
|
||||
"settings"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user