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
8ffe35a0
Commit
8ffe35a0
authored
Oct 08, 2021
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.39
parent
ca623d15
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
66 additions
and
69 deletions
+66
-69
FYGE.d.ts
build/FYGE.d.ts
+9
-18
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
+9
-18
package.json
package.json
+1
-1
record.txt
record.txt
+10
-0
const.ts
src/2d/const.ts
+1
-1
Lottie.ts
src/2d/ui/Lottie.ts
+9
-3
index.ts
src/2d/utils/index.ts
+16
-16
toDisplayDataURL.ts
src/2d/utils/toDisplayDataURL.ts
+5
-6
D3Renderer.ts
src/3d/D3Renderer.ts
+2
-2
getCusShader.ts
src/3d/shaders/getCusShader.ts
+2
-2
No files found.
build/FYGE.d.ts
View file @
8ffe35a0
declare
namespace
FYGE
{
export
const
VERSION
=
"2.0.3
8
"
;
declare
namespace
FYGE
{
export
const
VERSION
=
"2.0.3
9
"
;
export
const
osType
:
"ios"
|
"android"
|
"pc"
;
...
...
@@ -4283,6 +4283,8 @@ export class CanvasRenderer extends SystemRenderer {
destroyPlugins
():
void
;
}
export
function
toDisplayDataURL
(
obj
:
DisplayObject
,
rect
?:
Rectangle
,
typeInfo
?:
any
,
bgColor
?:
number
):
string
;
export
function
uid
():
number
;
export
function
getBackupCanvasCtx
():
CanvasRenderingContext2D
;
...
...
@@ -4309,27 +4311,10 @@ export const TextureCache: any;
export
const
BaseTextureCache
:
any
;
export
const
TextureSheetCache
:
any
;
export
function
destroyTextureCache
():
void
;
export
function
clearTextureCache
():
void
;
export
const
GlobalPro
:
{
/**
* 舞台渲染类型,
*/
stageRenderType
:
typeof
RENDERER_TYPE
;
/**
* 实际渲染分辨率
*/
dpi
:
number
;
/**
* 图集间隙
*/
padding
:
number
;
}
export
function
isWebGLSupported
():
boolean
;
export
function
removeItems
(
arr
:
Array
<
any
>
,
startIdx
:
number
,
removeCount
:
number
):
void
;
...
...
@@ -8901,6 +8886,12 @@ export const getBezierEasing: (a: any, b: any, c: any, d: any, nm?: any) => any
export
function
buildBezierProp
(
pt1
:
any
,
pt2
:
any
,
pt3
:
any
,
pt4
:
any
,
startIndex
:
any
,
endIndex
:
any
,
time
:
any
,
fnc
:
any
):
any
[];
export
class
Lottie
extends
AnimationNode
{
/**
* 是否使用Graphics矢量作为遮罩,默认false不使用,即使用Shape
* 使用Shape时在webgl模式下会新建一张离屏canvas,增加内存
* 有内存要求时可尝试设置为true,
*/
static
useGraphicsMask
:
boolean
;
/**
* 原始数据,尽量只获取,不修改
*/
...
...
build/fyge.min.js
View file @
8ffe35a0
This diff is collapsed.
Click to expand it.
build/fyge.min.js.map
View file @
8ffe35a0
This diff is collapsed.
Click to expand it.
build/types.d.ts
View file @
8ffe35a0
export
const
VERSION
=
"2.0.3
8
"
;
export
const
VERSION
=
"2.0.3
9
"
;
export
const
osType
:
"ios"
|
"android"
|
"pc"
;
...
...
@@ -4283,6 +4283,8 @@ export class CanvasRenderer extends SystemRenderer {
destroyPlugins
():
void
;
}
export
function
toDisplayDataURL
(
obj
:
DisplayObject
,
rect
?:
Rectangle
,
typeInfo
?:
any
,
bgColor
?:
number
):
string
;
export
function
uid
():
number
;
export
function
getBackupCanvasCtx
():
CanvasRenderingContext2D
;
...
...
@@ -4309,27 +4311,10 @@ export const TextureCache: any;
export
const
BaseTextureCache
:
any
;
export
const
TextureSheetCache
:
any
;
export
function
destroyTextureCache
():
void
;
export
function
clearTextureCache
():
void
;
export
const
GlobalPro
:
{
/**
* 舞台渲染类型,
*/
stageRenderType
:
typeof
RENDERER_TYPE
;
/**
* 实际渲染分辨率
*/
dpi
:
number
;
/**
* 图集间隙
*/
padding
:
number
;
}
export
function
isWebGLSupported
():
boolean
;
export
function
removeItems
(
arr
:
Array
<
any
>
,
startIdx
:
number
,
removeCount
:
number
):
void
;
...
...
@@ -8901,6 +8886,12 @@ export const getBezierEasing: (a: any, b: any, c: any, d: any, nm?: any) => any
export
function
buildBezierProp
(
pt1
:
any
,
pt2
:
any
,
pt3
:
any
,
pt4
:
any
,
startIndex
:
any
,
endIndex
:
any
,
time
:
any
,
fnc
:
any
):
any
[];
export
class
Lottie
extends
AnimationNode
{
/**
* 是否使用Graphics矢量作为遮罩,默认false不使用,即使用Shape
* 使用Shape时在webgl模式下会新建一张离屏canvas,增加内存
* 有内存要求时可尝试设置为true,
*/
static
useGraphicsMask
:
boolean
;
/**
* 原始数据,尽量只获取,不修改
*/
...
...
package.json
View file @
8ffe35a0
{
"name"
:
"fyge"
,
"version"
:
"2.0.3
8
"
,
"version"
:
"2.0.3
9
"
,
"description"
:
"canvas渲染引擎"
,
"main"
:
"./build/fyge.min.js"
,
"types"
:
"./build/types.d.ts"
,
...
...
record.txt
View file @
8ffe35a0
...
...
@@ -441,6 +441,14 @@
TextField的updateText方法,把s._text += ""提到s._text判断前,为了赋值的0
3d的index添加导出OrthographicCamera
2.0.39 Lottie添加静态属性useGraphicsMask,为了createLottieMask函数可以判断用Graphics或Shape
utils里toDisplayDataURL修改导出方式,注释TextureSheetCache和GlobalPro
toDisplayDataURL文件修改toDisplayDataURL导出方式,不用default
D3Renderer的flush方法里mat.map和mat.envMap添加判断valid
getCusShader的useMap和useEnvMap添加判断valid
外层canvas标签的transform数据在获取鼠标坐标时并未考虑,比如旋转
...
...
@@ -463,6 +471,8 @@
lottie的tm字段时啥
lottie的rx ry rz or
深度检测加透明度混合流程,
开启深度检测,gl.enable(gl.DEPTH_TEST)
绘制所有非透明对象,
...
...
src/2d/const.ts
View file @
8ffe35a0
...
...
@@ -7,7 +7,7 @@
* @name VERSION
* @type {string}
*/
export
const
VERSION
=
"2.0.3
8
"
;
export
const
VERSION
=
"2.0.3
9
"
;
/**
...
...
src/2d/ui/Lottie.ts
View file @
8ffe35a0
...
...
@@ -6,10 +6,16 @@ import { BaseTexture, Texture } from "../texture";
import
{
getBezierEasing
}
from
"./forLottie/BezierEaser"
import
{
buildBezierProp
}
from
"./forLottie/buildBezierProp"
;
import
{
createImage
,
TextureCache
}
from
"../utils"
;
import
{
Shape
}
from
"../graphics"
;
import
{
Shape
,
Graphics
}
from
"../graphics"
;
import
{
AnimationNode
}
from
"./AnimationNode"
;
export
class
Lottie
extends
AnimationNode
{
/**
* 是否使用Graphics矢量作为遮罩,默认false不使用,即使用Shape
* 使用Shape时在webgl模式下会新建一张离屏canvas,增加内存
* 有内存要求时可尝试设置为true,
*/
static
useGraphicsMask
:
boolean
=
false
;
/**
* 原始数据,尽量只获取,不修改
*/
...
...
@@ -711,8 +717,8 @@ function createLottieTracks(
* @param h
* @returns
*/
function
createLottieMask
(
masksProperties
:
ILottieMaskData
[],
w
:
number
,
h
:
number
):
Shape
{
var
mask
=
new
Shape
();
function
createLottieMask
(
masksProperties
:
ILottieMaskData
[],
w
:
number
,
h
:
number
):
Graphics
|
Shape
{
var
mask
=
Lottie
.
useGraphicsMask
?
new
Graphics
()
:
new
Shape
();
mask
.
beginFill
();
masksProperties
.
forEach
((
m
)
=>
{
if
(
m
.
mode
!==
'n'
)
{
...
...
src/2d/utils/index.ts
View file @
8ffe35a0
...
...
@@ -7,7 +7,7 @@ import { RENDERER_TYPE } from "../const";
import
{
createCanvas
,
getEnv
}
from
"./tbminiAdapte"
;
export
*
from
'./twiddle'
;
export
{
default
as
toDisplayDataURL
}
from
"./toDisplayDataURL"
;
export
*
from
"./toDisplayDataURL"
;
// export * from "./getTintedTexture";//外部用不到
// export * from "./mapWebGLBlendModes";//只在webglState里使用一次,外部用不到
...
...
@@ -206,7 +206,7 @@ export const BaseTextureCache = Object.create(null);
/**
* 记录TextureSheet,便于帧动画贴图数据查找,暂时不用
*/
export
const
TextureSheetCache
=
Object
.
create
(
null
);
//
export const TextureSheetCache = Object.create(null);
/**
* 销毁所有缓存的纹理和基础纹理
...
...
@@ -242,20 +242,20 @@ export function clearTextureCache() {
* 用于记录引擎全局属性记录,暂时没用到,考虑废弃
* 除了引擎内部修改赋值,外部仅供读取
*/
export
const
GlobalPro
=
{
/**
* 舞台渲染类型,
*/
stageRenderType
:
RENDERER_TYPE
,
/**
* 实际渲染分辨率
*/
dpi
:
1
,
/**
* 图集间隙
*/
padding
:
2
,
}
//
export const GlobalPro = {
//
/**
//
* 舞台渲染类型,
//
*/
//
stageRenderType: RENDERER_TYPE,
//
/**
//
* 实际渲染分辨率
//
*/
//
dpi: 1,
//
/**
//
* 图集间隙
//
*/
//
padding: 2,
//
}
let
webglSupported
:
boolean
;
/**
...
...
src/2d/utils/toDisplayDataURL.ts
View file @
8ffe35a0
...
...
@@ -5,13 +5,13 @@ import { DisplayObject } from "../display/DisplayObject";
import
{
createCanvas
}
from
"./tbminiAdapte"
;
// 作为将显示对象导出成图片的render渲染器
// 作为将显示对象导出成图片的render渲染器
,所以无法截取3d场景,3d场景暂时自己处理显隐裁切,用toDataURL获取,以后考虑改成WebglRenderer
let
_dRender
:
CanvasRenderer
=
null
;
let
_dCanvas
let
tempMatrix
=
new
Matrix
()
/**
* 将显示对象转成base64的图片数据
*
小程序上有问题,尽量不用,矢量图的canvas绘制
被删了
*
淘宝小程序上有问题,不用,canvas的toDataURL
被删了
* @method toDisplayDataURL
* @static
* @param {DisplayObject} obj 显示对象
...
...
@@ -26,13 +26,12 @@ let tempMatrix = new Matrix()
* width: 441,
* height: 694
* }, {
* type: "jpeg"//数据类型jpg/png
* type: "jpeg"//数据类型jp
e
g/png
* quality: 90//图片质量值1-100,png格式不需要设置quality
* },
'#CDDBEB'
);
* },
0xffffff
);
*
* Tip:在一些需要上传图片,编辑图片,需要提交图片数据,分享作品又或者长按保存作品的项目,运用toDisplayDataURL方法把显示对象base64就是最好不过的选择了。
*/
export
default
function
toDisplayDataURL
(
export
function
toDisplayDataURL
(
obj
:
DisplayObject
,
rect
:
Rectangle
=
null
,
typeInfo
/*: { type: "png" | "jpeg", quality?: number }*/
=
null
,
...
...
src/3d/D3Renderer.ts
View file @
8ffe35a0
...
...
@@ -213,7 +213,7 @@ export class D3Renderer extends ObjectRenderer {
}
}
//是否带贴图,贴图考虑下图集,也就是texture的uv是否是01
if
(
mat
.
map
)
{
if
(
mat
.
map
&&
mat
.
map
.
valid
)
{
let
map
=
mat
.
map
;
//找纹理,绑定纹理,多个纹理也是一样的方法
uniforms
[
"uMap"
]
=
textureManager
.
bindTexture
(
map
,
undefined
,
false
);
...
...
@@ -225,7 +225,7 @@ export class D3Renderer extends ObjectRenderer {
uniforms
[
"uUvTransform"
]
=
map
.
transform
.
mapCoord
.
toArray
(
true
);
}
//是否带环境贴图
if
(
mat
.
envMap
)
{
//环境贴图先不考虑图集的情况,一般一张大jpg
if
(
mat
.
envMap
&&
mat
.
envMap
.
valid
)
{
//环境贴图先不考虑图集的情况,一般一张大jpg
//找纹理,绑定纹理,多个纹理也是一样的方法
uniforms
[
"uEnvMap"
]
=
textureManager
.
bindTexture
(
mat
.
envMap
,
undefined
,
false
);;
//反射率
...
...
src/3d/shaders/getCusShader.ts
View file @
8ffe35a0
...
...
@@ -37,8 +37,8 @@ export function getCusShader(
lightAffect
:
material
.
_lightAffect
,
useMap
:
!!
material
.
map
,
useEnvMap
:
!!
material
.
envMap
,
useMap
:
!!
material
.
map
&&
material
.
map
.
valid
,
useEnvMap
:
!!
material
.
envMap
&&
material
.
envMap
.
valid
,
combine
:
material
.
combine
,
useVertexColor
:
!!
material
.
useVertexColor
,
...
...
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