# 矢量点
使用Point组件创建矢量点。
import { Point } from '@tx3d/core';
// 创建空实体
const entity = engine.createEntity();
// 添加Point组件
const point = entity.addComponent( Point, {
size: 32,
outlineColor: '#229900',
outlineWidth: 3,
opacity: 1.0,
visibleDistance: 1000.0,
shape: 'cross'
} );
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
提示
矢量点组件初始化参数,详见PointParameters。
# 属性
🌏 size 尺寸
// 获取矢量点尺寸
const size = point.size;
// 设置矢量点尺寸
point.size = 32;
1
2
3
4
5
2
3
4
5
🌏 color 颜色
// 获取矢量点颜色
const color = point.color;
// 设置矢量点颜色
point.color = '#ff00de';
1
2
3
4
5
2
3
4
5
🌏 outline 描边可见性
// 获取矢量点描边可见性
const outline = point.outline;
// 设置矢量点描边可见性
point.outline = true;
1
2
3
4
5
2
3
4
5
🌏 outlineWidth 描边宽度
// 获取矢量点描边宽度
const outlineWidth = point.outlineWidth;
// 设置矢量点描边宽度
point.outlineWidth = 2.0;
1
2
3
4
5
2
3
4
5
🌏 outlineColor 描边颜色
// 获取矢量点描边颜色
const outlineColor = point.outlineColor;
// 设置矢量点描边颜色
point.outlineColor = '#00ff00';
1
2
3
4
5
2
3
4
5
🌏 opacity 透明度
// 获取矢量点透明度
const opacity = point.opacity;
// 设置矢量点透明度
point.opacity = 0.75;
1
2
3
4
5
2
3
4
5
🌏 visibleDistance 可视距离
// 获取矢量点可视距离
const visibleDistance = point.visibleDistance;
// 设置矢量点可视距离
point.visibleDistance = 1500.0;
1
2
3
4
5
2
3
4
5
🌏 occluded 是否可遮挡
// 获取矢量点是否可遮挡
const occluded = point.occluded;
// 设置矢量点是否可遮挡
point.occluded = false;
1
2
3
4
5
2
3
4
5