mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-25 19:28:28 +00:00
完善 docs
This commit is contained in:
parent
142e19d075
commit
d081c60b05
@ -9,7 +9,7 @@
|
||||
"packageName": "org.cocos2d.helloworld",
|
||||
"startScene": "cab4af66-dc74-41b5-8826-79b3a30ba99a",
|
||||
"title": "Cocos-Service-Pack-Demo",
|
||||
"webOrientation": "auto",
|
||||
"webOrientation": "landscape",
|
||||
"inlineSpriteFrames": true,
|
||||
"inlineSpriteFrames_native": true,
|
||||
"mainCompressionType": "merge_all_json",
|
||||
|
@ -47,7 +47,7 @@ Vue.component("cc-richtext", {
|
||||
:multi-values="multi"
|
||||
></ui-prop>
|
||||
|
||||
<ui-prop v-prop="target.customMaterial"></ui-prop>
|
||||
<ui-prop v-show="!_isCharCacheMode()" v-prop="target.customMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.autoSwitchMaterial"></ui-prop>
|
||||
<ui-prop v-prop="target.allowDynamicAtlas"></ui-prop>
|
||||
<ui-prop v-prop="target.enableRetina"></ui-prop>
|
||||
@ -65,6 +65,9 @@ Vue.component("cc-richtext", {
|
||||
T: Editor.T,
|
||||
_isSystemFont() {
|
||||
return this.target.useSystemFont.value
|
||||
}
|
||||
},
|
||||
_isCharCacheMode() {
|
||||
return 2 === this.target.cacheMode.value
|
||||
},
|
||||
}
|
||||
});
|
||||
|
90
src/creator-sp.d.ts
vendored
90
src/creator-sp.d.ts
vendored
@ -144,6 +144,12 @@ declare module cc {
|
||||
*/
|
||||
getEmptyIndex(): number;
|
||||
|
||||
|
||||
/**
|
||||
* 自动设置纹理到空插槽,返回插槽下标,失败返回 -1(提供 cc.Texture2D)
|
||||
*/
|
||||
autoSetTexture(texture: cc.Texture2D): number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -175,14 +181,9 @@ declare module cc {
|
||||
|
||||
|
||||
/**
|
||||
* 使 cc.Texture2D 关联指定材质
|
||||
* 重置多纹理材质数组,再次使用请先初始化
|
||||
*/
|
||||
linkMaterial(texture: cc.Texture2D, handler: MultiHandler, index: number): void;
|
||||
|
||||
/**
|
||||
* 取消关联 cc.Texture2D 上已关联的材质
|
||||
*/
|
||||
unlinkMaterial(texture: cc.Texture2D): void;
|
||||
reset(): void;
|
||||
|
||||
}
|
||||
|
||||
@ -249,6 +250,11 @@ declare module cc {
|
||||
*/
|
||||
enableRetina: cc.RenderComponent.EnableType;
|
||||
|
||||
/**
|
||||
* 置渲染数据刷新脏标记
|
||||
*/
|
||||
setVertsDirty(): void;
|
||||
|
||||
}
|
||||
|
||||
namespace Label {
|
||||
@ -399,6 +405,11 @@ declare module cc {
|
||||
*/
|
||||
allowDynamicAtlas: cc.RenderComponent.EnableType;
|
||||
|
||||
/**
|
||||
* 置渲染数据刷新脏标记
|
||||
*/
|
||||
setVertsDirty(): void;
|
||||
|
||||
}
|
||||
|
||||
interface RichText {
|
||||
@ -423,6 +434,11 @@ declare module cc {
|
||||
*/
|
||||
enableRetina: cc.RenderComponent.EnableType;
|
||||
|
||||
/**
|
||||
* 置渲染数据刷新脏标记
|
||||
*/
|
||||
setVertsDirty(): void;
|
||||
|
||||
}
|
||||
|
||||
interface MotionStreak {
|
||||
@ -437,34 +453,10 @@ declare module cc {
|
||||
*/
|
||||
_checkSwitchMaterial(): void;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 富文本扩展组件
|
||||
*
|
||||
* 因为引擎未提供其 inspector 文件,无法修改组件的 inspector,所以扩展属性通过相应的扩展组件提供
|
||||
* 置渲染数据刷新脏标记
|
||||
*/
|
||||
class RichTextSP extends cc.Component {
|
||||
|
||||
/**
|
||||
* 自定义内部使用的材质
|
||||
*/
|
||||
customMaterial: cc.Material;
|
||||
|
||||
/**
|
||||
* 是否自动切换至贴图关联的材质
|
||||
*/
|
||||
autoSwitchMaterial: cc.RenderComponent.EnableType;
|
||||
|
||||
/**
|
||||
* 参与动态合图
|
||||
*/
|
||||
allowDynamicAtlas: cc.RenderComponent.EnableType;
|
||||
|
||||
/**
|
||||
* 是否启用渲染时进行缩放以适配高 DPI 屏幕
|
||||
*/
|
||||
enableRetina: cc.RenderComponent.EnableType;
|
||||
setVertsDirty(): void;
|
||||
|
||||
}
|
||||
|
||||
@ -475,6 +467,29 @@ declare module cc {
|
||||
*/
|
||||
_multiMaterial: cc.Material;
|
||||
|
||||
/**
|
||||
* 关联指定材质,返回是否成功
|
||||
*
|
||||
* @param material 材质
|
||||
* @param index 材质纹理插槽下标,默认自动寻找第一个空插槽
|
||||
*/
|
||||
linkMaterial(material: cc.Material, index?: number): boolean;
|
||||
|
||||
/**
|
||||
* 取消已关联的材质
|
||||
*/
|
||||
unlinkMaterial(): void;
|
||||
|
||||
/**
|
||||
* 获取已关联的材质
|
||||
*/
|
||||
getLinkedMaterial(): cc.Material;
|
||||
|
||||
/**
|
||||
* 是否已关联材质
|
||||
*/
|
||||
hasLinkedMaterial(): boolean;
|
||||
|
||||
}
|
||||
|
||||
interface Material {
|
||||
@ -556,7 +571,7 @@ declare module cc {
|
||||
/**
|
||||
* 已使用数量
|
||||
*/
|
||||
_count;
|
||||
_count: number;
|
||||
|
||||
/**
|
||||
* cc.RenderTexture
|
||||
@ -681,7 +696,7 @@ declare module cc {
|
||||
/**
|
||||
* cc.Texture2D UUID
|
||||
*/
|
||||
uuid: cc.Texture2D;
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* 使用该贴图的精灵帧数组
|
||||
@ -829,6 +844,11 @@ declare module sp {
|
||||
*/
|
||||
setRegion(slotName: string, attachmentName: string, region: spine.TextureRegion): boolean;
|
||||
|
||||
/**
|
||||
* 置渲染数据刷新脏标记
|
||||
*/
|
||||
setVertsDirty(): void;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user