dev
This commit is contained in:
@@ -1,20 +1,24 @@
|
||||
<template>
|
||||
<teleport to=".scene-designer .game-objects" v-if="active">
|
||||
<g @mousedown="$emit('target', {target:vd, attrs:['x1', 'y1'], delta: true})" :class="{gameObject: true, selected}" v-show="visible && parent.visible">
|
||||
<g @mousedown="$emit('target', {target:vd, attrs:['x1', 'y1'], delta: true})" :class="{gameObject: true, selected}"
|
||||
v-show="showInView">
|
||||
<line :x1="vd.x1" :y1="vd.y1" :x2="parent.vd.x1" :y2="parent.vd.y1"></line>
|
||||
<svg-icon :src="`/asset/thumb/${modelValue.go||0}.webp`" :x="vd.x1" :y="vd.y1" :size="37"></svg-icon>
|
||||
<text :x="vd.x1" :y="vd.y1" dy="58">{{ modelValue.title }}</text>
|
||||
<image v-if="modelValue.go" href="/static/svg/play-circle.svg" width="20" class="cursor-pointer"
|
||||
:x="vd.x1 + 37 - 10" :y="vd.y1 + 37 - 10" @click="$emit('preview', modelValue.go)">
|
||||
</image>
|
||||
</g>
|
||||
</teleport>
|
||||
<v-card v-if="selected" :title="modelValue.title">
|
||||
<v-card v-if="selected" :title="modelValue.title" class="mx-2" variant="text">
|
||||
<asset-selector @select="assignGameObject" type="GameObject">
|
||||
<template v-slot:activator="props">
|
||||
<v-btn v-bind="props" prepend-icon="mdi-panorama-outline" color="success" block>Choose game object</v-btn>
|
||||
</template>
|
||||
</asset-selector>
|
||||
<v-form class="py-4">
|
||||
<v-text-field density="compact" :label="$l.name" v-model="modelValue.title"></v-text-field>
|
||||
<v-textarea :label="$l.description" v-model="modelValue.description"></v-textarea>
|
||||
<v-text-field density="compact" :label="l.name" v-model="modelValue.title"></v-text-field>
|
||||
<v-textarea :label="l.description" v-model="modelValue.description"></v-textarea>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -24,7 +28,7 @@ import SvgIcon from './SvgIcon.vue';
|
||||
import Utils from '@/lib/utils';
|
||||
|
||||
export default {
|
||||
emits:['target'],
|
||||
emits:['target', 'preview'],
|
||||
components: { SvgIcon },
|
||||
data(){
|
||||
return {
|
||||
@@ -43,6 +47,12 @@ export default {
|
||||
visible: Boolean,
|
||||
parent: Object
|
||||
},
|
||||
computed:{
|
||||
showInView(){
|
||||
this.vd.__showInView = this.visible && this.parent.visible;
|
||||
return this.vd.__showInView;
|
||||
}
|
||||
},
|
||||
steps: [['x1', 'y1']],
|
||||
name: 'game-object',
|
||||
modifiers: ['x1', 'y1'],
|
||||
|
||||
Reference in New Issue
Block a user