mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 12:05:24 +00:00
[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.12 版本
This commit is contained in:
80
engine/extensions/cocostudio/editor/studio-component.js
Normal file
80
engine/extensions/cocostudio/editor/studio-component.js
Normal file
@@ -0,0 +1,80 @@
|
||||
Vue.component('cc-studio-component', {
|
||||
template: `
|
||||
<ui-prop v-prop="target.type"></ui-prop>
|
||||
|
||||
<div v-show="_isCheckbox()">
|
||||
<ui-prop v-prop="target.checkNormalBackFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.checkPressedBackFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.checkDisableBackFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.checkNormalFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.checkDisableFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.checkInteractable"></ui-prop>
|
||||
<ui-prop v-prop="target.isChecked"></ui-prop>
|
||||
</div>
|
||||
|
||||
<div v-show="_isTextAtlas()">
|
||||
<ui-prop v-prop="target.atlasFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.firstChar"></ui-prop>
|
||||
<ui-prop v-prop="target.charWidth"></ui-prop>
|
||||
<ui-prop v-prop="target.charHeight"></ui-prop>
|
||||
<ui-prop v-prop="target.string"></ui-prop>
|
||||
</div>
|
||||
|
||||
<div v-show="_isSliderBar()">
|
||||
<ui-prop v-prop="target.sliderBackFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.sliderBarFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.sliderBtnNormalFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.sliderBtnPressedFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.sliderBtnDisabledFrame"></ui-prop>
|
||||
<ui-prop v-prop="target.sliderInteractable"></ui-prop>
|
||||
<ui-prop v-prop="target.sliderProgress"></ui-prop>
|
||||
</div>
|
||||
|
||||
<div v-show="_isListView()">
|
||||
<ui-prop v-prop="target.listInertia"></ui-prop>
|
||||
<ui-prop v-prop="target.listDirection"></ui-prop>
|
||||
<ui-prop v-prop="target.listVerticalAlign" v-show="_isHList()"></ui-prop>
|
||||
<ui-prop v-prop="target.listHorizontalAlign" v-show="_isVList()"></ui-prop>
|
||||
<ui-prop v-prop="target.listPadding"></ui-prop>
|
||||
</div>
|
||||
`,
|
||||
|
||||
props: {
|
||||
target: {
|
||||
twoWay: true,
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
_isCheckbox() {
|
||||
let type = this.target.type.value;
|
||||
return type === cc.StudioComponent.ComponentType.CHECKBOX;
|
||||
},
|
||||
|
||||
_isTextAtlas() {
|
||||
let type = this.target.type.value;
|
||||
return type === cc.StudioComponent.ComponentType.TEXT_ATLAS;
|
||||
},
|
||||
|
||||
_isSliderBar() {
|
||||
let type = this.target.type.value;
|
||||
return type === cc.StudioComponent.ComponentType.SLIDER_BAR;
|
||||
},
|
||||
|
||||
_isListView() {
|
||||
let type = this.target.type.value;
|
||||
return type === cc.StudioComponent.ComponentType.LIST_VIEW;
|
||||
},
|
||||
|
||||
_isHList() {
|
||||
let dir = this.target.listDirection.value;
|
||||
return dir === cc.StudioComponent.ListDirection.HORIZONTAL;
|
||||
},
|
||||
|
||||
_isVList() {
|
||||
let dir = this.target.listDirection.value;
|
||||
return dir === cc.StudioComponent.ListDirection.VERTICAL;
|
||||
},
|
||||
}
|
||||
});
|
@@ -96,6 +96,7 @@ let ArmatureDisplay = cc.Class({
|
||||
editor: CC_EDITOR && {
|
||||
menu: 'i18n:MAIN_MENU.component.renderers/DragonBones',
|
||||
inspector: 'packages://inspector/inspectors/comps/skeleton2d.js',
|
||||
help: 'i18n:COMPONENT.help_url.dragonbones',
|
||||
},
|
||||
|
||||
statics: {
|
||||
|
@@ -42,6 +42,10 @@
|
||||
var _global = typeof window === 'undefined' ? global : window;
|
||||
if (!CC_NATIVERENDERER) {
|
||||
_global.dragonBones = require('./lib/dragonBones');
|
||||
// HACK: can't share the global dragonBones between all cc sub modules on Taobao platform.
|
||||
if (cc.sys.platform === cc.sys.TAOBAO || cc.sys.platform === cc.sys.TAOBAO_MINIGAME) {
|
||||
dragonBones = _global.dragonBones;
|
||||
}
|
||||
}
|
||||
|
||||
if (_global.dragonBones !== undefined) {
|
||||
|
@@ -480,7 +480,7 @@ sp.Skeleton = cc.Class({
|
||||
|
||||
// override base class _updateMaterial to set define value and clear material cache
|
||||
_updateMaterial () {
|
||||
let useTint = this.useTint;
|
||||
let useTint = this.useTint || (this.isAnimationCached() && !CC_NATIVERENDERER);
|
||||
let baseMaterial = this.getMaterial(0);
|
||||
if (baseMaterial) {
|
||||
const isMultiSupport = baseMaterial.material.isMultiSupport();
|
||||
@@ -535,7 +535,7 @@ sp.Skeleton = cc.Class({
|
||||
_updateUseTint () {
|
||||
let baseMaterial = this.getMaterial(0);
|
||||
if (baseMaterial) {
|
||||
let useTint = this.useTint;
|
||||
let useTint = this.useTint || (this.isAnimationCached() && !CC_NATIVERENDERER);
|
||||
if (baseMaterial.material.isMultiSupport()) {
|
||||
this._defineMaterialTint(baseMaterial, useTint);
|
||||
} else {
|
||||
|
@@ -925,7 +925,7 @@ export default class SpineAssembler extends Assembler {
|
||||
if (!baseMaterial) return;
|
||||
|
||||
_useMulti = baseMaterial.material.isMultiSupport();
|
||||
_useTint = comp.useTint;
|
||||
_useTint = comp.useTint || comp.isAnimationCached();
|
||||
_vertexFormat = _useTint ? (_useMulti ? VFTwoColorTexId : VFTwoColor) : (_useMulti ? VFOneColorTexId : (comp.isAnimationCached() ? VFTwoColor : VFOneColor));
|
||||
// x y u v color1 color2 or x y u v color
|
||||
_perVertexSize = _useTint ? (_useMulti ? 7 : 6) : (_useMulti ? 6 : (comp.isAnimationCached() ? 6 : 5));
|
||||
|
Reference in New Issue
Block a user