layabox 使用龍骨動畫的時候雜七雜八的事情很多
資源未載入完 崩潰
龍骨動畫新增幀動畫報錯等等
failed to load resource: net::err_file_not_found [file:///g:/program/20191112/bin/res/spine/undefined]
自己封裝了乙個 要用的拿去
/**@author ccj
* 通用版本動畫元件
* date:2019.11.27
export default class spinemr extends fairygui.gcomponent {
constructor(str: string) {
super()
this._url = str;
this.create()
public mfactory: laya.templet
public marmature: laya.skeleton
public iscomplete: boolean;
public _url: string
public rest() {
this.iscomplete = false
this._url = ""
private create() {
this.mfactory = new laya.templet();
this.mfactory.on(laya.event.complete, this, this.parsecomplete)//or 'complete'
this.mfactory.loadani(this._url)
public parsecomplete(): void {
this.marmature = this.mfactory.buildarmature(1);
this._container.addchild(this.marmature)
this.marmature.play(0, true, false, 0, 5000, false, false)
this.iscomplete = true
public playindex(nameorindex: any, loop: boolean, force: boolean = true, start: number = 0, end: number = 5000, freshskin: boolean = false, playaudio: boolean = false) {
if (!this.iscomplete) {
return
this.marmature.play(nameorindex, loop, force, start, end, freshskin, playaudio)
public pos(x: number, y: number) {
this.x = x;
this.y = y;
public scale(x: number, y: number) {
this.scalex = x;
this.scaley = y;
例子:this.effect = new spinemr("res/spine/skill-effect-fire-2.sk")
this.view.addchild(this.effect)
this.effect.pos(500,400)
this.effect.scale(0.5,0.5)
laya龍骨換裝 LayaAir之骨骼動畫 基礎
layaair可以是用dragonbone和spine生成的骨骼動畫檔案,但是需要將他們的動畫檔案進行轉化,轉化後的檔案才能夠被layaair識別.而無論是dragonbone還是spine都不是layaair官方工具,轉化的安全和相容性有些問題,這是乙個坑.到目前為止此轉化有2個問題 對版本的支援...
棗核型龍骨船
棗核型龍骨船 下面介紹一種外形酷似棗核的船舶。這種船體甲板外緣的前部是頂角為40度高為250cm的銳角三角形,在這個三角形後面是斜邊和上邊夾角為22度的高為500cm的等腰梯形,這個梯形的後邊是長為1200cm寬位586.01cm的矩形,在這個矩形的後面是斜邊和頂邊夾角為50度高為372.78cm的...
Layabox 實現 PageView 翻頁
layabox 中沒有 pageview這個元件,cocos creater中有,但是我們可以輕鬆地使用 list來實現pageview功能。具體方式是計算出滾動後要停在所在的cell的索引值,使用通過 list的tweento方法來滾動到相應位置。先看下面的效果 下面是 package else ...