Commit 30849061 authored by wjf's avatar wjf

2.0.25

parent 51e82c40
declare namespace FYGE{export const VERSION = "2.0.24";
declare namespace FYGE{export const VERSION = "2.0.25";
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;
......
This diff is collapsed.
This diff is collapsed.
export const VERSION = "2.0.24";
export const VERSION = "2.0.25";
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;
......
......@@ -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
{
"name": "fyge",
"version": "2.0.24",
"version": "2.0.25",
"description": "canvas渲染引擎",
"main": "./build/fyge.min.js",
"types": "./build/types.d.ts",
......
......@@ -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变形动画切换不回默认
......
......@@ -7,7 +7,7 @@
* @name VERSION
* @type {string}
*/
export const VERSION = "2.0.24";
export const VERSION = "2.0.25";
/**
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment