@zhongguo168a/yxeditor-common 0.0.14 → 0.0.16
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 +303 -198
- package/dist/index.esm.js +888 -606
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, SpriteAtlas, Vec2, Vec3, Vec4 } from 'cc';
|
|
1
|
+
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, SpriteAtlas, Camera, Canvas, Vec2, Vec3, Vec4, Widget, UITransform, math } from 'cc';
|
|
2
2
|
|
|
3
3
|
interface IError {
|
|
4
4
|
isCancel(): boolean;
|
|
@@ -1527,6 +1527,71 @@ declare class SamplePool {
|
|
|
1527
1527
|
*/
|
|
1528
1528
|
put(obj: any): void;
|
|
1529
1529
|
}
|
|
1530
|
+
/**
|
|
1531
|
+
* 对象池
|
|
1532
|
+
*/
|
|
1533
|
+
declare class SamplePoolSet {
|
|
1534
|
+
get(name: string): any;
|
|
1535
|
+
put(name: string, item: any): void;
|
|
1536
|
+
protected pools: {};
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
declare class ArrayUtil {
|
|
1540
|
+
lastItem(array: any[]): any;
|
|
1541
|
+
unique(array: any[]): any[];
|
|
1542
|
+
removeSelf(arr: any[], item: any): void;
|
|
1543
|
+
/**
|
|
1544
|
+
*
|
|
1545
|
+
* @param arr
|
|
1546
|
+
* @param desc 降序
|
|
1547
|
+
*/
|
|
1548
|
+
sortNumber(arr: any[], desc?: boolean): any[];
|
|
1549
|
+
sortString(arr: any[], desc?: boolean): any[];
|
|
1550
|
+
getByPath(target: any, key: string): any;
|
|
1551
|
+
sortObject(arr: any[], desc: boolean, ...paths: string[]): any[];
|
|
1552
|
+
sortBySeq(arr: any[], desc: boolean, seq: {
|
|
1553
|
+
[key: string]: number;
|
|
1554
|
+
}, key?: string): any[];
|
|
1555
|
+
indexOfConf(arr: any[], caller: any, f: (item: any) => boolean): number;
|
|
1556
|
+
}
|
|
1557
|
+
declare const arrayutil: ArrayUtil;
|
|
1558
|
+
|
|
1559
|
+
declare class BitUtil {
|
|
1560
|
+
getState(state: number, key: number): boolean;
|
|
1561
|
+
setState(state: number, key: number, value: boolean): number;
|
|
1562
|
+
/**
|
|
1563
|
+
* @param state
|
|
1564
|
+
* @param key
|
|
1565
|
+
*/
|
|
1566
|
+
getStateBig(state: bigint, key: bigint): boolean;
|
|
1567
|
+
setStateBig(state: bigint, key: bigint, value: boolean): bigint;
|
|
1568
|
+
/**
|
|
1569
|
+
* key从0开始
|
|
1570
|
+
* @param val
|
|
1571
|
+
*/
|
|
1572
|
+
convertToState(val: {
|
|
1573
|
+
[key: string]: boolean;
|
|
1574
|
+
}): number;
|
|
1575
|
+
/**
|
|
1576
|
+
* 判断是否匹配
|
|
1577
|
+
* @param target
|
|
1578
|
+
* @param match 0-返回true
|
|
1579
|
+
*/
|
|
1580
|
+
match(target: number, match: number): boolean;
|
|
1581
|
+
}
|
|
1582
|
+
declare const bitutil: BitUtil;
|
|
1583
|
+
|
|
1584
|
+
declare class CameraUtil {
|
|
1585
|
+
getUICamera(): Camera;
|
|
1586
|
+
}
|
|
1587
|
+
declare let camerautil: CameraUtil;
|
|
1588
|
+
|
|
1589
|
+
declare class CanvasUtil {
|
|
1590
|
+
getCanvas(): Canvas;
|
|
1591
|
+
protected onSceneDestroyed(event: any): void;
|
|
1592
|
+
_canvas: Canvas;
|
|
1593
|
+
}
|
|
1594
|
+
declare let canvasutil: CanvasUtil;
|
|
1530
1595
|
|
|
1531
1596
|
declare class ConvertUtil {
|
|
1532
1597
|
anyToBoolean(val: any, defaultValue?: boolean): boolean;
|
|
@@ -1542,6 +1607,97 @@ declare class ConvertUtil {
|
|
|
1542
1607
|
}
|
|
1543
1608
|
declare const convertutil: ConvertUtil;
|
|
1544
1609
|
|
|
1610
|
+
declare class DocUtil {
|
|
1611
|
+
copyToClip(value: string): boolean;
|
|
1612
|
+
selectText(textbox: any, startIndex: any, stopIndex: any): void;
|
|
1613
|
+
}
|
|
1614
|
+
declare var docutil: DocUtil;
|
|
1615
|
+
|
|
1616
|
+
declare class EventUtil {
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* 框架的事件
|
|
1620
|
+
*/
|
|
1621
|
+
declare const eventutil: EventUtil;
|
|
1622
|
+
|
|
1623
|
+
declare class FloatUtil {
|
|
1624
|
+
epsilon: number;
|
|
1625
|
+
neq(a: number, b: number, threshold?: number): boolean;
|
|
1626
|
+
eq(a: number, b: number, threshold?: number): boolean;
|
|
1627
|
+
gt(a: number, b: number, threshold?: number): boolean;
|
|
1628
|
+
lt(a: number, b: number, threshold?: number): boolean;
|
|
1629
|
+
geq(a: number, b: number, threshold?: number): boolean;
|
|
1630
|
+
leq(a: number, b: number, threshold?: number): boolean;
|
|
1631
|
+
}
|
|
1632
|
+
declare let floatutil: FloatUtil;
|
|
1633
|
+
|
|
1634
|
+
declare namespace formatutil {
|
|
1635
|
+
/**
|
|
1636
|
+
* 格式化数字
|
|
1637
|
+
* @param format 第nn天
|
|
1638
|
+
* @param val
|
|
1639
|
+
*/
|
|
1640
|
+
function toChinese(formatter: string, val: number): string;
|
|
1641
|
+
/**
|
|
1642
|
+
* 转换为 x亿x万
|
|
1643
|
+
* @param val
|
|
1644
|
+
*/
|
|
1645
|
+
function format数字使用万亿(val: number | string): string;
|
|
1646
|
+
/**
|
|
1647
|
+
* 格式化货币,每N位增加一个逗号识别
|
|
1648
|
+
* @param val
|
|
1649
|
+
* @param N
|
|
1650
|
+
*/
|
|
1651
|
+
function format数字使用逗号(val: number | string, N?: number): string;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
declare enum GeometryDirection {
|
|
1655
|
+
East = 0,
|
|
1656
|
+
SouthEast = 1,
|
|
1657
|
+
South = 2,
|
|
1658
|
+
SouthWest = 3,
|
|
1659
|
+
West = 4,
|
|
1660
|
+
NorthWest = 5,
|
|
1661
|
+
North = 6,
|
|
1662
|
+
NorthEast = 7
|
|
1663
|
+
}
|
|
1664
|
+
declare class GeometryUtil {
|
|
1665
|
+
/**
|
|
1666
|
+
* mode,8表示八方向,2表示二方向(左右),4表示4方向
|
|
1667
|
+
* @param dot
|
|
1668
|
+
* @param mode
|
|
1669
|
+
*/
|
|
1670
|
+
angleToDirection(dot: number, mode?: number): GeometryDirection;
|
|
1671
|
+
}
|
|
1672
|
+
declare let geoutil: GeometryUtil;
|
|
1673
|
+
|
|
1674
|
+
declare class IdentUtil {
|
|
1675
|
+
/**
|
|
1676
|
+
* 设置时间的基线,通过减去已经过去的时间,可缩短id长度
|
|
1677
|
+
* 注:同一个项目必须拥有同样的基线,否则有几率出现相同的id!
|
|
1678
|
+
* 注2:基线必须与精度符合
|
|
1679
|
+
* @param time
|
|
1680
|
+
*/
|
|
1681
|
+
setTimeBaseline(time: number): void;
|
|
1682
|
+
protected _baseline: number;
|
|
1683
|
+
/**
|
|
1684
|
+
* 设置时间的精度
|
|
1685
|
+
* @param precision
|
|
1686
|
+
*/
|
|
1687
|
+
setTimePrecision(precision: "ms" | "s"): void;
|
|
1688
|
+
protected _precision: string;
|
|
1689
|
+
/**
|
|
1690
|
+
* 设置随机数的长度
|
|
1691
|
+
* @param value
|
|
1692
|
+
*/
|
|
1693
|
+
setRandLength(value?: number): void;
|
|
1694
|
+
protected _randLength: number;
|
|
1695
|
+
genOne(): string;
|
|
1696
|
+
protected _count: number;
|
|
1697
|
+
protected _lastTime: number;
|
|
1698
|
+
}
|
|
1699
|
+
declare const identutil: IdentUtil;
|
|
1700
|
+
|
|
1545
1701
|
declare class MapUtil {
|
|
1546
1702
|
/**
|
|
1547
1703
|
* 获取所欲的值
|
|
@@ -1657,32 +1813,16 @@ declare class MapUtil {
|
|
|
1657
1813
|
}
|
|
1658
1814
|
declare const maputil: MapUtil;
|
|
1659
1815
|
|
|
1660
|
-
declare class
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
* x, y 使用 鼠标点击事件产生的 event.getLocation()坐标
|
|
1669
|
-
* @param target
|
|
1670
|
-
* @param x
|
|
1671
|
-
* @param y
|
|
1672
|
-
*/
|
|
1673
|
-
hitTest(target: Node, x: number, y: number): boolean;
|
|
1674
|
-
findNode(node: Node, name: string): Node;
|
|
1675
|
-
walk(node: Node, f: (target: Node) => boolean): void;
|
|
1676
|
-
_walk(node: Node, f: (target: Node) => boolean): boolean;
|
|
1677
|
-
}
|
|
1678
|
-
declare const uiutil: UIUtil;
|
|
1679
|
-
|
|
1680
|
-
declare class EventUtil {
|
|
1816
|
+
declare class MathUtil {
|
|
1817
|
+
version: number;
|
|
1818
|
+
TempVec2: Vec2;
|
|
1819
|
+
TempVec3: Vec3;
|
|
1820
|
+
TempVec4: Vec4;
|
|
1821
|
+
convertVec2to3(vec2: Vec2, useTemp?: boolean): Vec3;
|
|
1822
|
+
convertVec3to2(vec3: Vec3, useTemp?: boolean): Vec2;
|
|
1823
|
+
isOdd(value: number): boolean;
|
|
1681
1824
|
}
|
|
1682
|
-
|
|
1683
|
-
* 框架的事件
|
|
1684
|
-
*/
|
|
1685
|
-
declare const eventutil: EventUtil;
|
|
1825
|
+
declare const mathutil: MathUtil;
|
|
1686
1826
|
|
|
1687
1827
|
declare class NetUtil {
|
|
1688
1828
|
decodeLocationSearch(search: string): any;
|
|
@@ -1695,116 +1835,14 @@ declare class NetUtil {
|
|
|
1695
1835
|
}
|
|
1696
1836
|
declare const netutil: NetUtil;
|
|
1697
1837
|
|
|
1698
|
-
declare class
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
* @param arr
|
|
1705
|
-
* @param desc 降序
|
|
1706
|
-
*/
|
|
1707
|
-
sortNumber(arr: any[], desc?: boolean): any[];
|
|
1708
|
-
sortString(arr: any[], desc?: boolean): any[];
|
|
1709
|
-
getByPath(target: any, key: string): any;
|
|
1710
|
-
sortObject(arr: any[], desc: boolean, ...paths: string[]): any[];
|
|
1711
|
-
sortBySeq(arr: any[], desc: boolean, seq: {
|
|
1712
|
-
[key: string]: number;
|
|
1713
|
-
}, key?: string): any[];
|
|
1714
|
-
indexOfConf(arr: any[], caller: any, f: (item: any) => boolean): number;
|
|
1715
|
-
}
|
|
1716
|
-
declare const arrayutil: ArrayUtil;
|
|
1717
|
-
|
|
1718
|
-
declare class ScaleUtil {
|
|
1719
|
-
tenToAny: string[];
|
|
1720
|
-
allstr: string;
|
|
1721
|
-
randString(size: number, n: number): string;
|
|
1722
|
-
decimalTo(num: number, n: number): string;
|
|
1723
|
-
findkey(instr: string): number;
|
|
1724
|
-
toDecimal(num: string, n: number): number;
|
|
1725
|
-
}
|
|
1726
|
-
declare const scaleutil: ScaleUtil;
|
|
1727
|
-
|
|
1728
|
-
declare class BitUtil {
|
|
1729
|
-
getState(state: number, key: number): boolean;
|
|
1730
|
-
setState(state: number, key: number, value: boolean): number;
|
|
1731
|
-
/**
|
|
1732
|
-
* @param state
|
|
1733
|
-
* @param key
|
|
1734
|
-
*/
|
|
1735
|
-
getStateBig(state: bigint, key: bigint): boolean;
|
|
1736
|
-
setStateBig(state: bigint, key: bigint, value: boolean): bigint;
|
|
1737
|
-
/**
|
|
1738
|
-
* key从0开始
|
|
1739
|
-
* @param val
|
|
1740
|
-
*/
|
|
1741
|
-
convertToState(val: {
|
|
1742
|
-
[key: string]: boolean;
|
|
1743
|
-
}): number;
|
|
1744
|
-
/**
|
|
1745
|
-
* 判断是否匹配
|
|
1746
|
-
* @param target
|
|
1747
|
-
* @param match 0-返回true
|
|
1748
|
-
*/
|
|
1749
|
-
match(target: number, match: number): boolean;
|
|
1750
|
-
}
|
|
1751
|
-
declare const bitutil: BitUtil;
|
|
1752
|
-
|
|
1753
|
-
declare class StringUtil {
|
|
1754
|
-
lowerFirst(key: string): string;
|
|
1755
|
-
upperFirst(key: string): string;
|
|
1756
|
-
cjkEncode(text: any): string;
|
|
1757
|
-
replaceFormat(format: string, source: any): string;
|
|
1758
|
-
/**
|
|
1759
|
-
*
|
|
1760
|
-
* @param format
|
|
1761
|
-
* @param source
|
|
1762
|
-
*/
|
|
1763
|
-
evalFormat(format: string, source: any): string;
|
|
1764
|
-
splitLast(val: string, separator: string): string;
|
|
1765
|
-
/**
|
|
1766
|
-
* 从最后一个分隔符截断字符串,返回截断的左右字符串
|
|
1767
|
-
* @param val
|
|
1768
|
-
* @param separator
|
|
1769
|
-
*/
|
|
1770
|
-
splitLastArray(val: string, separator: string): [string, string];
|
|
1771
|
-
/**
|
|
1772
|
-
* 截断字符串
|
|
1773
|
-
* @param val
|
|
1774
|
-
* @param separator
|
|
1775
|
-
* @return [最终的字符串, 被截断的字符串]
|
|
1776
|
-
*/
|
|
1777
|
-
truncateLast(val: string, separator: string): [string, string];
|
|
1778
|
-
fill(str: string, char: string, length: number): string;
|
|
1779
|
-
}
|
|
1780
|
-
declare const stringutil: StringUtil;
|
|
1781
|
-
|
|
1782
|
-
declare class IdentUtil {
|
|
1783
|
-
/**
|
|
1784
|
-
* 设置时间的基线,通过减去已经过去的时间,可缩短id长度
|
|
1785
|
-
* 注:同一个项目必须拥有同样的基线,否则有几率出现相同的id!
|
|
1786
|
-
* 注2:基线必须与精度符合
|
|
1787
|
-
* @param time
|
|
1788
|
-
*/
|
|
1789
|
-
setTimeBaseline(time: number): void;
|
|
1790
|
-
protected _baseline: number;
|
|
1791
|
-
/**
|
|
1792
|
-
* 设置时间的精度
|
|
1793
|
-
* @param precision
|
|
1794
|
-
*/
|
|
1795
|
-
setTimePrecision(precision: "ms" | "s"): void;
|
|
1796
|
-
protected _precision: string;
|
|
1797
|
-
/**
|
|
1798
|
-
* 设置随机数的长度
|
|
1799
|
-
* @param value
|
|
1800
|
-
*/
|
|
1801
|
-
setRandLength(value?: number): void;
|
|
1802
|
-
protected _randLength: number;
|
|
1803
|
-
genOne(): string;
|
|
1804
|
-
protected _count: number;
|
|
1805
|
-
protected _lastTime: number;
|
|
1838
|
+
declare class PathUtil {
|
|
1839
|
+
getDir(path: string): string;
|
|
1840
|
+
getRelativePath(fromPath: string, toPath: string): string;
|
|
1841
|
+
getSamePath(fromPath: string, toPath: string): string;
|
|
1842
|
+
protected validatePath(path: string): void;
|
|
1843
|
+
protected splitPath(path: string): string[];
|
|
1806
1844
|
}
|
|
1807
|
-
declare const
|
|
1845
|
+
declare const pathutil: PathUtil;
|
|
1808
1846
|
|
|
1809
1847
|
declare class RandUtil {
|
|
1810
1848
|
/**
|
|
@@ -1836,17 +1874,6 @@ declare class RandUtil {
|
|
|
1836
1874
|
}
|
|
1837
1875
|
declare const randutil: RandUtil;
|
|
1838
1876
|
|
|
1839
|
-
declare class MathUtil {
|
|
1840
|
-
version: number;
|
|
1841
|
-
TempVec2: Vec2;
|
|
1842
|
-
TempVec3: Vec3;
|
|
1843
|
-
TempVec4: Vec4;
|
|
1844
|
-
convertVec2to3(vec2: Vec2, useTemp?: boolean): Vec3;
|
|
1845
|
-
convertVec3to2(vec3: Vec3, useTemp?: boolean): Vec2;
|
|
1846
|
-
isOdd(value: number): boolean;
|
|
1847
|
-
}
|
|
1848
|
-
declare const mathutil: MathUtil;
|
|
1849
|
-
|
|
1850
1877
|
declare class ResUtil {
|
|
1851
1878
|
loadResource(path: string): Promise<[any, IError]>;
|
|
1852
1879
|
preloadResource(path: string): Promise<[any, IError]>;
|
|
@@ -1859,6 +1886,48 @@ declare class ResUtil {
|
|
|
1859
1886
|
}
|
|
1860
1887
|
declare var resutil: ResUtil;
|
|
1861
1888
|
|
|
1889
|
+
declare function parsePlist(plist: any, texture: any): SpriteAtlas;
|
|
1890
|
+
declare function loadAtlas(url: any, callback: any): void;
|
|
1891
|
+
|
|
1892
|
+
declare class ScaleUtil {
|
|
1893
|
+
tenToAny: string[];
|
|
1894
|
+
allstr: string;
|
|
1895
|
+
randString(size: number, n: number): string;
|
|
1896
|
+
decimalTo(num: number, n: number): string;
|
|
1897
|
+
findkey(instr: string): number;
|
|
1898
|
+
toDecimal(num: string, n: number): number;
|
|
1899
|
+
}
|
|
1900
|
+
declare const scaleutil: ScaleUtil;
|
|
1901
|
+
|
|
1902
|
+
declare class StringUtil {
|
|
1903
|
+
lowerFirst(key: string): string;
|
|
1904
|
+
upperFirst(key: string): string;
|
|
1905
|
+
cjkEncode(text: any): string;
|
|
1906
|
+
replaceFormat(format: string, source: any): string;
|
|
1907
|
+
/**
|
|
1908
|
+
*
|
|
1909
|
+
* @param format
|
|
1910
|
+
* @param source
|
|
1911
|
+
*/
|
|
1912
|
+
evalFormat(format: string, source: any): string;
|
|
1913
|
+
splitLast(val: string, separator: string): string;
|
|
1914
|
+
/**
|
|
1915
|
+
* 从最后一个分隔符截断字符串,返回截断的左右字符串
|
|
1916
|
+
* @param val
|
|
1917
|
+
* @param separator
|
|
1918
|
+
*/
|
|
1919
|
+
splitLastArray(val: string, separator: string): [string, string];
|
|
1920
|
+
/**
|
|
1921
|
+
* 截断字符串
|
|
1922
|
+
* @param val
|
|
1923
|
+
* @param separator
|
|
1924
|
+
* @return [最终的字符串, 被截断的字符串]
|
|
1925
|
+
*/
|
|
1926
|
+
truncateLast(val: string, separator: string): [string, string];
|
|
1927
|
+
fill(str: string, char: string, length: number): string;
|
|
1928
|
+
}
|
|
1929
|
+
declare const stringutil: StringUtil;
|
|
1930
|
+
|
|
1862
1931
|
declare class TimeUtil {
|
|
1863
1932
|
sleep(time: number): Promise<void>;
|
|
1864
1933
|
/**
|
|
@@ -1875,68 +1944,104 @@ declare class TimeUtil {
|
|
|
1875
1944
|
}
|
|
1876
1945
|
declare const timeutil: TimeUtil;
|
|
1877
1946
|
|
|
1878
|
-
declare
|
|
1879
|
-
East = 0,
|
|
1880
|
-
SouthEast = 1,
|
|
1881
|
-
South = 2,
|
|
1882
|
-
SouthWest = 3,
|
|
1883
|
-
West = 4,
|
|
1884
|
-
NorthWest = 5,
|
|
1885
|
-
North = 6,
|
|
1886
|
-
NorthEast = 7
|
|
1887
|
-
}
|
|
1888
|
-
declare class GeometryUtil {
|
|
1947
|
+
declare class TreeUtil {
|
|
1889
1948
|
/**
|
|
1890
|
-
*
|
|
1891
|
-
* @param
|
|
1892
|
-
* @param
|
|
1949
|
+
* 保存指定标签[tag]的值等于[value]的节点
|
|
1950
|
+
* @param root
|
|
1951
|
+
* @param key 存储的键
|
|
1952
|
+
* @param tag
|
|
1953
|
+
* @param value
|
|
1893
1954
|
*/
|
|
1894
|
-
|
|
1895
|
-
}
|
|
1896
|
-
declare let geoutil: GeometryUtil;
|
|
1897
|
-
|
|
1898
|
-
declare namespace formatutil {
|
|
1955
|
+
saveTagToLocalStorage(root: TreeRoot, key: string, tag: string, value: any): void;
|
|
1899
1956
|
/**
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1902
|
-
* @param
|
|
1957
|
+
* 从ls中加载指定标签[tag]的值还原到[root]。
|
|
1958
|
+
* 返回localStorage是否存在键值
|
|
1959
|
+
* @param root
|
|
1960
|
+
* @param key
|
|
1961
|
+
* @param tag
|
|
1962
|
+
* @param value
|
|
1903
1963
|
*/
|
|
1904
|
-
|
|
1964
|
+
loadTagFromLocalStorage(root: TreeRoot, key: string, tag: string, value: any): boolean;
|
|
1965
|
+
}
|
|
1966
|
+
declare var treeutil: TreeUtil;
|
|
1967
|
+
|
|
1968
|
+
declare class UIUtil {
|
|
1905
1969
|
/**
|
|
1906
|
-
*
|
|
1907
|
-
*
|
|
1970
|
+
* 格式化节点的uuid,用于树结构
|
|
1971
|
+
* 树结构的路径的反斜杠与uuid有冲突
|
|
1972
|
+
* @param uuid
|
|
1908
1973
|
*/
|
|
1909
|
-
|
|
1974
|
+
formatUUIDForTree(uuid: string): string;
|
|
1910
1975
|
/**
|
|
1911
|
-
*
|
|
1912
|
-
* @param
|
|
1913
|
-
* @param
|
|
1976
|
+
* x, y 使用 鼠标点击事件产生的 event.getLocation()坐标
|
|
1977
|
+
* @param target
|
|
1978
|
+
* @param x
|
|
1979
|
+
* @param y
|
|
1914
1980
|
*/
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
epsilon: number;
|
|
1920
|
-
neq(a: number, b: number, threshold?: number): boolean;
|
|
1921
|
-
eq(a: number, b: number, threshold?: number): boolean;
|
|
1922
|
-
gt(a: number, b: number, threshold?: number): boolean;
|
|
1923
|
-
lt(a: number, b: number, threshold?: number): boolean;
|
|
1924
|
-
geq(a: number, b: number, threshold?: number): boolean;
|
|
1925
|
-
leq(a: number, b: number, threshold?: number): boolean;
|
|
1981
|
+
hitTest(target: Node, x: number, y: number): boolean;
|
|
1982
|
+
findNode(node: Node, name: string): Node;
|
|
1983
|
+
walk(node: Node, f: (target: Node) => boolean): void;
|
|
1984
|
+
_walk(node: Node, f: (target: Node) => boolean): boolean;
|
|
1926
1985
|
}
|
|
1927
|
-
declare
|
|
1986
|
+
declare const uiutil: UIUtil;
|
|
1928
1987
|
|
|
1929
|
-
declare class
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
protected
|
|
1934
|
-
protected
|
|
1988
|
+
declare class WidgetAlign {
|
|
1989
|
+
node: Node;
|
|
1990
|
+
targetNode: Node;
|
|
1991
|
+
protected nodeWidget: Widget;
|
|
1992
|
+
protected parentTransform: UITransform;
|
|
1993
|
+
protected targetTransform: UITransform;
|
|
1994
|
+
protected uipos: math.Vec3;
|
|
1995
|
+
constructor(node: Node, targetNode: Node);
|
|
1996
|
+
topTop(distance?: number): void;
|
|
1997
|
+
topBottom(distance?: number): void;
|
|
1998
|
+
leftleft(distance?: number): void;
|
|
1999
|
+
leftRight(distance?: number): void;
|
|
2000
|
+
}
|
|
2001
|
+
declare class WidgetUtil {
|
|
2002
|
+
/**
|
|
2003
|
+
* 与目标顶对齐
|
|
2004
|
+
* @param node 需要修改的节点
|
|
2005
|
+
* @param parent 对齐的父节点
|
|
2006
|
+
* @param distance
|
|
2007
|
+
*/
|
|
2008
|
+
alignTop(node: Node, parent: Node, distance?: number): void;
|
|
2009
|
+
/**
|
|
2010
|
+
* 与目标顶对齐,node和target都必须在渲染树中
|
|
2011
|
+
* @param node 需要修改的节点
|
|
2012
|
+
* @param target 对齐目标
|
|
2013
|
+
* @param distance
|
|
2014
|
+
*/
|
|
2015
|
+
alignTopWorld(node: Node, target: Node, distance?: number): void;
|
|
2016
|
+
/**
|
|
2017
|
+
* 与目标顶对齐,node和target都必须在渲染树中
|
|
2018
|
+
* @param node 需要修改的节点
|
|
2019
|
+
* @param target 对齐目标
|
|
2020
|
+
* @param distance
|
|
2021
|
+
*/
|
|
2022
|
+
alignBottomWorld(node: Node, target: Node, distance?: number): void;
|
|
2023
|
+
/**
|
|
2024
|
+
* 调整【node】的widget,对齐【targetNode】
|
|
2025
|
+
* @param node
|
|
2026
|
+
* @param targetNode
|
|
2027
|
+
*/
|
|
2028
|
+
align(node: Node, targetNode: Node): WidgetAlign;
|
|
2029
|
+
/**
|
|
2030
|
+
* 与目标右对齐
|
|
2031
|
+
* @param node 需要修改的节点
|
|
2032
|
+
* @param parent 对齐的父节点
|
|
2033
|
+
* @param distance
|
|
2034
|
+
*/
|
|
2035
|
+
alignLeft(node: Node, parent: Node, distance?: number): void;
|
|
2036
|
+
/**
|
|
2037
|
+
* 与目标右对齐
|
|
2038
|
+
* @param node 需要修改的节点
|
|
2039
|
+
* @param target 对齐目标
|
|
2040
|
+
* @param distance
|
|
2041
|
+
*/
|
|
2042
|
+
alignLeftWorld(node: Node, target: Node, distance?: number): void;
|
|
1935
2043
|
}
|
|
1936
|
-
declare
|
|
1937
|
-
|
|
1938
|
-
declare function parsePlist(plist: any, texture: any): SpriteAtlas;
|
|
1939
|
-
declare function loadAtlas(url: any, callback: any): void;
|
|
2044
|
+
declare var widgetutil: WidgetUtil;
|
|
1940
2045
|
|
|
1941
|
-
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SampleCallbackList, SamplePool, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, XAssetManager, XEvent, arrayutil, assetx, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, uidict, uimgr, uiutil };
|
|
2046
|
+
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uidict, uimgr, uiutil, widgetutil };
|
|
1942
2047
|
export type { CreatorFunction, DisposeFunction, IController, IError, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction };
|