@zhongguo168a/yxeditor-common 0.0.139 → 0.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -2
- package/dist/index.esm.js +40 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as cc from 'cc';
|
|
2
|
-
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, Camera, Canvas,
|
|
2
|
+
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, Vec2, Texture2D, SpriteAtlas, Camera, Canvas, Vec3, Vec4, Widget, UITransform, math } from 'cc';
|
|
3
3
|
|
|
4
4
|
interface IError {
|
|
5
5
|
isCancel(): boolean;
|
|
@@ -1647,6 +1647,26 @@ declare class AssetLoader extends Dispatcher {
|
|
|
1647
1647
|
protected _failList: List<LoaderItem>;
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
|
+
/**
|
|
1651
|
+
* 自动生成等距图集的frame描述表。
|
|
1652
|
+
* 用于减少创建atlas文件的过程。
|
|
1653
|
+
*
|
|
1654
|
+
* @param atlasSize 图集的像素尺寸
|
|
1655
|
+
* @param gridSize 每格的像素尺寸
|
|
1656
|
+
* @param keyFormat 名称格式化字符串,例如 "%d.png" 或 "tile_%d.png"
|
|
1657
|
+
* @param maxCount 可选,限制生成数量
|
|
1658
|
+
* @returns atlas数据对象
|
|
1659
|
+
*/
|
|
1660
|
+
declare function create等距图集(atlasSize: Vec2, gridSize: Vec2, keyFormat?: string, maxCount?: number): Record<string, any>;
|
|
1661
|
+
/**
|
|
1662
|
+
*
|
|
1663
|
+
* @param name 图集的名称
|
|
1664
|
+
* @param plist plist格式的json文件内容
|
|
1665
|
+
* @param texture
|
|
1666
|
+
* @returns
|
|
1667
|
+
*/
|
|
1668
|
+
declare function parseAtlas(plist: any, texture: Texture2D): SpriteAtlas;
|
|
1669
|
+
|
|
1650
1670
|
declare enum LogLevel {
|
|
1651
1671
|
DEBUG = 0,
|
|
1652
1672
|
INFO = 1,
|
|
@@ -2195,5 +2215,5 @@ declare class WidgetUtil {
|
|
|
2195
2215
|
}
|
|
2196
2216
|
declare var widgetutil: WidgetUtil;
|
|
2197
2217
|
|
|
2198
|
-
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewModelComponent, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parsePlist, pathutil, randutil, resutil, routeViews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
|
|
2218
|
+
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewModelComponent, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeViews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
|
|
2199
2219
|
export type { CreatorFunction, DisposeFunction, IController, IError, IEventDispatcher, IExtend, IListItem, IModel, IModule, ITreeListItem, RecycleFunction };
|
package/dist/index.esm.js
CHANGED
|
@@ -4937,6 +4937,45 @@ class XAssetManager {
|
|
|
4937
4937
|
}
|
|
4938
4938
|
let assetx = new XAssetManager();
|
|
4939
4939
|
|
|
4940
|
+
/**
|
|
4941
|
+
* 自动生成等距图集的frame描述表。
|
|
4942
|
+
* 用于减少创建atlas文件的过程。
|
|
4943
|
+
*
|
|
4944
|
+
* @param atlasSize 图集的像素尺寸
|
|
4945
|
+
* @param gridSize 每格的像素尺寸
|
|
4946
|
+
* @param keyFormat 名称格式化字符串,例如 "%d.png" 或 "tile_%d.png"
|
|
4947
|
+
* @param maxCount 可选,限制生成数量
|
|
4948
|
+
* @returns atlas数据对象
|
|
4949
|
+
*/
|
|
4950
|
+
function create等距图集(atlasSize, gridSize, keyFormat = "%d.png", maxCount) {
|
|
4951
|
+
const cols = Math.floor(atlasSize.x / gridSize.x);
|
|
4952
|
+
const rows = Math.floor(atlasSize.y / gridSize.y);
|
|
4953
|
+
const total = maxCount !== null && maxCount !== void 0 ? maxCount : cols * rows;
|
|
4954
|
+
const frames = {};
|
|
4955
|
+
let index = 0;
|
|
4956
|
+
for (let y = 0; y < rows; y++) {
|
|
4957
|
+
for (let x = 0; x < cols; x++) {
|
|
4958
|
+
if (index >= total)
|
|
4959
|
+
break;
|
|
4960
|
+
const key = keyFormat.replace("%d", (index + 1).toString());
|
|
4961
|
+
const frame = {
|
|
4962
|
+
frame: {
|
|
4963
|
+
x: x * gridSize.x,
|
|
4964
|
+
y: y * gridSize.y,
|
|
4965
|
+
w: gridSize.x,
|
|
4966
|
+
h: gridSize.y
|
|
4967
|
+
},
|
|
4968
|
+
rotated: false,
|
|
4969
|
+
trimmed: false,
|
|
4970
|
+
sourceSize: { w: gridSize.x, h: gridSize.y },
|
|
4971
|
+
spriteSourceSize: { x: 0, y: 0, w: gridSize.x, h: gridSize.y }
|
|
4972
|
+
};
|
|
4973
|
+
frames[key] = frame;
|
|
4974
|
+
index++;
|
|
4975
|
+
}
|
|
4976
|
+
}
|
|
4977
|
+
return frames;
|
|
4978
|
+
}
|
|
4940
4979
|
/**
|
|
4941
4980
|
*
|
|
4942
4981
|
* @param name 图集的名称
|
|
@@ -6970,5 +7009,5 @@ class WidgetUtil {
|
|
|
6970
7009
|
}
|
|
6971
7010
|
var widgetutil = new WidgetUtil();
|
|
6972
7011
|
|
|
6973
|
-
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewModelComponent, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parsePlist, pathutil, randutil, resutil, routeViews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
|
|
7012
|
+
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewModelComponent, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeViews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
|
|
6974
7013
|
//# sourceMappingURL=index.esm.js.map
|