Skip to content

Commit 377cf42

Browse files
committed
面板名称, 反选区域
1 parent 77dad20 commit 377cf42

3 files changed

Lines changed: 28 additions & 11 deletions

File tree

layout.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $(document).ready(function() {
1717
myDocker.registerPanelType('NodePanel', {
1818
faicon: 'cubes',
1919
onCreate: function(myPanel) {
20+
myPanel.title("节点面板")
2021
myPanel.initSize(200, 400)
2122
myPanel.maxSize(500, Infinity)
2223
var $node = $('<ve-nodeorder id="NodePanel" style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;"></ve-nodeorder>')
@@ -28,6 +29,7 @@ $(document).ready(function() {
2829
myDocker.registerPanelType('ResourcePanel', {
2930
faicon: 'cubes',
3031
onCreate: function(myPanel) {
32+
myPanel.title("资源面板")
3133
var $node = $('<ve-resorder style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;"></ve-resorder>')
3234
myPanel._main = $node[0]
3335
myPanel.layout().addItem($node).stretch('', '100%')
@@ -37,6 +39,7 @@ $(document).ready(function() {
3739
myDocker.registerPanelType('ControlPanel', {
3840
faicon: 'cubes',
3941
onCreate: function(myPanel) {
42+
myPanel.title("控制面板")
4043
myPanel.maxSize(200, Infinity)
4144
var $node = $('<ve-controlpanel style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;"></ve-controlpanel>')
4245
myPanel._main = $node[0]
@@ -47,6 +50,7 @@ $(document).ready(function() {
4750
myDocker.registerPanelType('ConsolePanel', {
4851
faicon: 'cubes',
4952
onCreate: function(myPanel) {
53+
myPanel.title("控制台面板")
5054
var $node = $('<ve-console style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;"></ve-console>')
5155
myPanel._main = $node[0]
5256
myPanel.layout().addItem($node).stretch('', '100%')
@@ -57,6 +61,7 @@ $(document).ready(function() {
5761
isPersistent: true,
5862
faicon: 'cubes',
5963
onCreate: function(myPanel) {
64+
myPanel.title("渲染面板")
6065
myPanel.closeable(false);
6166

6267
var $tabArea = $('<div style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;">')
@@ -178,6 +183,7 @@ $(document).ready(function() {
178183
myDocker.registerPanelType('PropPanel', {
179184
faicon: 'cubes',
180185
onCreate: function(myPanel) {
186+
myPanel.title("属性面板")
181187
var $node = $('<ve-proppanel style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;"></ve-proppanel>')
182188
myPanel._main = $node[0]
183189
myPanel.layout().addItem($node).stretch('', '100%')

packages/renderpanel/panel/renderpanel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@
376376
return true
377377
}
378378

379+
if (isBaseType(node)) {
380+
return false
381+
}
382+
379383
var children = node.getChildren()
380384
for (var i = 0; i < children.length; i++) {
381385
this.recursiveAddChild(children[i], rect, isClick)
@@ -816,7 +820,7 @@
816820
let rect = object.selector
817821
let left = Math.min(rect.ex, rect.ex + rect.left)
818822
let top = Math.min(rect.ey, rect.ey + rect.top)
819-
let isClick = rect.left <= 5 && rect.top <= 5
823+
let isClick = Math.abs(rect.left) <= 5 && Math.abs(rect.top) <= 5
820824
let width = Math.abs(rect.left),
821825
height = Math.abs(rect.top)
822826
let e = object.e

project-test/ui/fdsafds.ui

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@
66
"type": "Scene",
77
"children": [
88
{
9+
"touchEnabled": false,
910
"width": "89",
1011
"height": "28",
1112
"x": 464,
1213
"y": 239,
1314
"type": "UIText",
14-
"touchEnabled": false,
1515
"string": "VisualUI",
1616
"fontSize": 24,
1717
"fontName": "Arial"
1818
},
1919
{
20+
"touchEnabled": true,
2021
"width": "228",
2122
"height": "74",
2223
"x": 618,
2324
"y": 135,
2425
"type": "UIButton",
25-
"touchEnabled": true,
2626
"scale9Enable": true,
2727
"bgNormal": "uires/button.png",
2828
"titleText": "fdsfds",
2929
"fontName": "Arial",
3030
"fontSize": 16
3131
},
3232
{
33+
"touchEnabled": true,
3334
"width": "40",
3435
"height": "40",
3536
"x": 499,
3637
"y": 106,
3738
"type": "UICheckBox",
38-
"touchEnabled": true,
3939
"back": "res/default/CheckBoxNormal.png",
4040
"backSelect": "res/default/CheckBoxSelect.png",
4141
"active": "res/default/CheckBoxNodeNormal.png",
@@ -44,31 +44,34 @@
4444
"select": true
4545
},
4646
{
47+
"touchEnabled": true,
4748
"width": "200",
4849
"height": "14",
4950
"x": 714,
5051
"y": 260,
5152
"type": "UISlider",
52-
"touchEnabled": true,
53+
"scale9Enable": false,
5354
"barBg": "res/default/SliderBack.png",
5455
"barProgress": "res/default/SliderBar.png",
5556
"barNormalBall": "res/default/SliderNodeNormal.png"
5657
},
5758
{
59+
"touchEnabled": false,
5860
"width": "40",
5961
"height": "40",
6062
"x": 105,
6163
"y": 287,
6264
"type": "UIWidget",
63-
"touchEnabled": false,
65+
"anchorX": 0.5,
66+
"anchorY": 0.5,
6467
"children": [
6568
{
69+
"touchEnabled": false,
6670
"width": "46",
6771
"height": "46",
6872
"x": 0,
6973
"y": 0,
7074
"type": "UIImage",
71-
"touchEnabled": false,
7275
"spriteFrame": "res/default/Sprite.png"
7376
}
7477
]
@@ -98,12 +101,13 @@
98101
"spriteFrame": "res/default/shurukuang.png"
99102
},
100103
{
104+
"touchEnabled": true,
105+
"_lock": true,
101106
"width": "46",
102107
"height": "36",
103108
"x": 204,
104109
"y": 143,
105110
"type": "UIButton",
106-
"touchEnabled": true,
107111
"bgNormal": "res/default/ButtonNormal.png",
108112
"titleText": "Button",
109113
"fontName": "Arial",
@@ -116,12 +120,13 @@
116120
]
117121
},
118122
{
123+
"touchEnabled": true,
124+
"_lock": true,
119125
"width": "40",
120126
"height": "40",
121127
"x": 699,
122128
"y": 67,
123129
"type": "UICheckBox",
124-
"touchEnabled": true,
125130
"back": "res/default/CheckBoxNormal.png",
126131
"backSelect": "res/default/CheckBoxSelect.png",
127132
"active": "res/default/CheckBoxNodeNormal.png",
@@ -130,17 +135,19 @@
130135
"select": true
131136
},
132137
{
138+
"touchEnabled": false,
133139
"width": "140",
134140
"height": "27",
135141
"x": 401,
136142
"y": 331,
137143
"type": "UITextAtlas",
138-
"touchEnabled": false,
139144
"string": "4532246",
140145
"charMapFile": "res/default/AltasNum.png",
141146
"itemWidth": 20,
142147
"itemHeight": 27,
143-
"mapStartChar": "0"
148+
"mapStartChar": "0",
149+
"anchorX": 0.5,
150+
"anchorY": 0.5
144151
}
145152
]
146153
}

0 commit comments

Comments
 (0)