Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fyge_for_tb
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王剑峰
fyge_for_tb
Commits
30849061
Commit
30849061
authored
Jun 10, 2021
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.25
parent
51e82c40
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
86 deletions
+73
-86
FYGE.d.ts
build/FYGE.d.ts
+1
-11
fyge.min.js
build/fyge.min.js
+1
-1
fyge.min.js.map
build/fyge.min.js.map
+1
-1
types.d.ts
build/types.d.ts
+1
-11
cc.js
examples/cc.js
+61
-1
package.json
package.json
+1
-1
record.txt
record.txt
+4
-1
const.ts
src/2d/const.ts
+1
-1
index.ts
src/2d/utils/index.ts
+0
-58
tbminiAdapte.ts
src/2d/utils/tbminiAdapte.ts
+2
-0
No files found.
build/FYGE.d.ts
View file @
30849061
declare
namespace
FYGE
{
export
const
VERSION
=
"2.0.2
4
"
;
declare
namespace
FYGE
{
export
const
VERSION
=
"2.0.2
5
"
;
export
const
osType
:
"ios"
|
"android"
|
"pc"
;
...
...
@@ -4302,16 +4302,6 @@ export function rgb2hex(rgb: number[]): number;
export
function
getRGBA
(
color
:
string
,
alpha
:
number
):
string
;
export
function
decomposeDataUri
(
dataUri
:
any
):
{
mediaType
:
any
;
subType
:
any
;
charset
:
any
;
encoding
:
any
;
data
:
any
;
}
export
function
getUrlFileExtension
(
url
:
string
):
string
;
export
function
sign
(
n
:
number
):
number
;
export
function
premultiplyTint
(
tint
:
number
,
alpha
:
number
):
number
;
...
...
build/fyge.min.js
View file @
30849061
This diff is collapsed.
Click to expand it.
build/fyge.min.js.map
View file @
30849061
This diff is collapsed.
Click to expand it.
build/types.d.ts
View file @
30849061
export
const
VERSION
=
"2.0.2
4
"
;
export
const
VERSION
=
"2.0.2
5
"
;
export
const
osType
:
"ios"
|
"android"
|
"pc"
;
...
...
@@ -4302,16 +4302,6 @@ export function rgb2hex(rgb: number[]): number;
export
function
getRGBA
(
color
:
string
,
alpha
:
number
):
string
;
export
function
decomposeDataUri
(
dataUri
:
any
):
{
mediaType
:
any
;
subType
:
any
;
charset
:
any
;
encoding
:
any
;
data
:
any
;
}
export
function
getUrlFileExtension
(
url
:
string
):
string
;
export
function
sign
(
n
:
number
):
number
;
export
function
premultiplyTint
(
tint
:
number
,
alpha
:
number
):
number
;
...
...
examples/cc.js
View file @
30849061
...
...
@@ -248,4 +248,64 @@ export class ShowWord extends FYGE.TextField {
},
deltaTime
*
m
)
}
}
}
\ No newline at end of file
}
/////////////uri解析基本用不到,考虑沉淀到其他地方后废弃decomposeDataUri
/**
* Regexp for data URI.
* Based on: {@link https://github.com/ragingwind/data-uri-regex}
*
* @static
* @constant
* @example data:image/png;base64
*/
const
DATA_URI
=
/^
\s
*data:
(?:([\w
-
]
+
)\/([\w
+.-
]
+
))?(?:
;charset=
([\w
-
]
+
))?(?:
;
(
base64
))?
,
(
.*
)
/i
;
/**
* Split a data URI into components. Returns undefined if
* parameter `dataUri` is not a valid data URI.
*
* @memberof utils
* @function decomposeDataUri
* @param {string} dataUri - the data URI to check
* @return {utils~DecomposedDataUri|undefined} The decomposed data uri or undefined
*/
export
function
decomposeDataUri
(
dataUri
)
{
const
dataUriMatch
=
DATA_URI
.
exec
(
dataUri
);
if
(
dataUriMatch
)
{
return
{
mediaType
:
dataUriMatch
[
1
]
?
dataUriMatch
[
1
].
toLowerCase
()
:
undefined
,
subType
:
dataUriMatch
[
2
]
?
dataUriMatch
[
2
].
toLowerCase
()
:
undefined
,
charset
:
dataUriMatch
[
3
]
?
dataUriMatch
[
3
].
toLowerCase
()
:
undefined
,
encoding
:
dataUriMatch
[
4
]
?
dataUriMatch
[
4
].
toLowerCase
()
:
undefined
,
data
:
dataUriMatch
[
5
],
};
}
return
undefined
;
}
//路劲后缀名解析基本用不到,考虑沉淀到其他地方后废弃getUrlFileExtension
/**
* Regexp for image type by extension.
*
* @static
* @constant
* @type {RegExp|string}
* @example `image.png`
*/
const
URL_FILE_EXTENSION
=
/
\.(\w{3,4})(?:
$|
\?
|#
)
/i
;
/**
* 根据图片路径获取图片扩展名
* @memberof utils
* @function getUrlFileExtension
* @param {string} url - the image path
* @return {string|undefined} image extension
*/
export
function
getUrlFileExtension
(
url
)
{
const
extension
=
URL_FILE_EXTENSION
.
exec
(
url
);
if
(
extension
)
{
return
extension
[
1
].
toLowerCase
();
}
return
undefined
;
}
\ No newline at end of file
package.json
View file @
30849061
{
"name"
:
"fyge"
,
"version"
:
"2.0.2
4
"
,
"version"
:
"2.0.2
5
"
,
"description"
:
"canvas渲染引擎"
,
"main"
:
"./build/fyge.min.js"
,
"types"
:
"./build/types.d.ts"
,
...
...
record.txt
View file @
30849061
...
...
@@ -341,7 +341,8 @@
DrawOrderAniTrack添加resetValue重置方法
Stage构造函数添加webglOption参数,以防webgl需要一些特殊属性时无法传入,比如抗锯齿antialias等
2.0.25 tbminiAdapte的createCanvas方法改回原先的方式
utils删除了decomposeDataUri和getUrlFileExtension
现在不改,索引数据过大时得用Uint32Array,同时开扩展gl.getExtension( "OES_element_index_uint" )和drawElements改参数类型为gl.UNSIGNED_INT
...
...
@@ -349,6 +350,8 @@
现在不改,D3Renderer里的aSkinIndex传值用了Uint8Array,类型是gl.UNSIGNED_BYTE,估计那个外星头是因为这个
现在不改,到时loadSpine要改成返回数据(方便创建多个实例)
引擎内自执行的东西容易导致报错,以后考虑修改,改成方法获取比较安全
检查spine动画区间问题
检查spine变形动画切换不回默认
...
...
src/2d/const.ts
View file @
30849061
...
...
@@ -7,7 +7,7 @@
* @name VERSION
* @type {string}
*/
export
const
VERSION
=
"2.0.2
4
"
;
export
const
VERSION
=
"2.0.2
5
"
;
/**
...
...
src/2d/utils/index.ts
View file @
30849061
...
...
@@ -151,64 +151,6 @@ export function getRGBA(color: string, alpha: number): string {
return
color
;
}
/////////////uri解析基本用不到,考虑沉淀到其他地方后废弃decomposeDataUri
/**
* Regexp for data URI.
* Based on: {@link https://github.com/ragingwind/data-uri-regex}
*
* @static
* @constant
* @example data:image/png;base64
*/
const
DATA_URI
:
any
=
/^
\s
*data:
(?:([\w
-
]
+
)\/([\w
+.-
]
+
))?(?:
;charset=
([\w
-
]
+
))?(?:
;
(
base64
))?
,
(
.*
)
/i
;
/**
* Split a data URI into components. Returns undefined if
* parameter `dataUri` is not a valid data URI.
*
* @memberof utils
* @function decomposeDataUri
* @param {string} dataUri - the data URI to check
* @return {utils~DecomposedDataUri|undefined} The decomposed data uri or undefined
*/
export
function
decomposeDataUri
(
dataUri
)
{
const
dataUriMatch
=
DATA_URI
.
exec
(
dataUri
);
if
(
dataUriMatch
)
{
return
{
mediaType
:
dataUriMatch
[
1
]
?
dataUriMatch
[
1
].
toLowerCase
()
:
undefined
,
subType
:
dataUriMatch
[
2
]
?
dataUriMatch
[
2
].
toLowerCase
()
:
undefined
,
charset
:
dataUriMatch
[
3
]
?
dataUriMatch
[
3
].
toLowerCase
()
:
undefined
,
encoding
:
dataUriMatch
[
4
]
?
dataUriMatch
[
4
].
toLowerCase
()
:
undefined
,
data
:
dataUriMatch
[
5
],
};
}
return
undefined
;
}
//路劲后缀名解析基本用不到,考虑沉淀到其他地方后废弃getUrlFileExtension
/**
* Regexp for image type by extension.
*
* @static
* @constant
* @type {RegExp|string}
* @example `image.png`
*/
const
URL_FILE_EXTENSION
:
any
=
/
\.(\w{3,4})(?:
$|
\?
|#
)
/i
;
/**
* 根据图片路径获取图片扩展名
* @memberof utils
* @function getUrlFileExtension
* @param {string} url - the image path
* @return {string|undefined} image extension
*/
export
function
getUrlFileExtension
(
url
:
string
):
string
{
const
extension
=
URL_FILE_EXTENSION
.
exec
(
url
);
if
(
extension
)
{
return
extension
[
1
].
toLowerCase
();
}
return
undefined
;
}
/**
* 获取正负号标记
* 0 +1 -1
...
...
src/2d/utils/tbminiAdapte.ts
View file @
30849061
...
...
@@ -71,6 +71,8 @@ export function setEnv(e: "tb" | "web") {
* 创建一个离屏的canvas
*/
export
function
createCanvas
():
HTMLCanvasElement
{
//@ts-ignore 先这么改把,以后再改TODO,Texture.WHITE有个自执行,所以在setEnv前就会执行web的链路,以后考虑兼容document
return
document
&&
document
.
createElement
(
"canvas"
)
||
my
.
_createOffscreenCanvas
();
//web环境
if
(
getEnv
()
==
"web"
)
return
document
.
createElement
(
"canvas"
);
//@ts-ignore
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment