We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2 有提到了 View 核心,延伸的核心模組還有 ViewSequence 這個部分,不過目的不同。
他是用來儲存一個序列化資料的模組,所以雖然字面上是 ViewSequence,但是骨子裡跟 View 沒有關係。
ViewSequence
View
這個模組初始化可以傳入這幾個數值(使用 Object 的方式傳入,
Object
array
index
loop
firstNode
lastNode
這個模組建立後,裡面會再建立一個結構函示,名稱雖為 Backing,不過外部使用時,是用 _ 來取得。
Backing
_
getValue(n)
setValue(n, value)
value
reindex(start, removeCount, insertCount)
getPrevious
getNext
getIndex
toString
unshift(value)
push(value)
splice(index, howMany)
swap(other)
.index
getSize
var surf1 = new Surface({ size: [120, 100], properties: { backgroundColor: 'black' } }); var surf2 = new Surface({ size: [130, 100], properties: { backgroundColor: 'black' } }); var surf3 = new Surface({ size: [140, 100], properties: { backgroundColor: 'red' } }); var surf4 = new Surface({ size: [150, 100], properties: { backgroundColor: 'black' } }); var views = new ViewSequence({ array: [surf1, surf2, surf3, surf4], index: 2 }); var mainCtx = Engine.createContext(); mainCtx.add(views.getNext());
The text was updated successfully, but these errors were encountered:
No branches or pull requests
#2 有提到了 View 核心,延伸的核心模組還有 ViewSequence 這個部分,不過目的不同。
ViewSequence 核心
他是用來儲存一個序列化資料的模組,所以雖然字面上是
ViewSequence
,但是骨子裡跟View
沒有關係。初始化方法
這個模組初始化可以傳入這幾個數值(使用
Object
的方式傳入,array
傳入一個陣列,這個陣列用來儲存你的物件。index
定義第一個元素,這個模組用這個元素來當作第一個被 render 的物件loop
當巡迴過整個陣列之後,決定是否要返回第一個(或最後一個)元素firstNode
第一個元素lastNode
最後一個元素這個模組建立後,裡面會再建立一個結構函示,名稱雖為
Backing
,不過外部使用時,是用_
來取得。模組方法
getValue(n)
取得第 n 個物件setValue(n, value)
將第 n 個物件設定為value
reindex(start, removeCount, insertCount)
重新定義索引值getPrevious
取得目前索引值的上一個物件getNext
取得目前索引值的下一個物件getIndex
取得當前的索引值toString
將目前索引值輸出為字串unshift(value)
從開頭新增一個物件push(value)
從尾端新增一個物件splice(index, howMany)
從第 index 物件開始切割,然後移除掉 howMany 個物件swap(other)
交換物件位置,與模組設定中的.index
物件交換位置getSize
取得該.index
物件的尺寸簡易操作
The text was updated successfully, but these errors were encountered: