mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
How to use
This commit is contained in:
24
README.md
24
README.md
@@ -22,4 +22,26 @@ A stand alone editor implementation of the UE's Blueprint visual language. (WIP)
|
||||
|
||||
## How to use:
|
||||
|
||||
TODO
|
||||
1. Include `dist/css/ueb-style.css` stylesheet in your page.
|
||||
2. Define eventual CSS variables
|
||||
```HTML
|
||||
<style>
|
||||
ueb-blueprint {
|
||||
--ueb-height: 500px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
3. Import the class Blueprint in JavaScript (this library uses modules).
|
||||
```HTML
|
||||
<script type="module">
|
||||
import { Blueprint } from "./dist/ueblueprint.js"
|
||||
</script>
|
||||
```
|
||||
4. Define your blueprint the by just writing the code inside a `ueb-blueprint`, inside a `template` element
|
||||
```HTML
|
||||
<ueb-blueprint>
|
||||
<template>
|
||||
...
|
||||
</template>
|
||||
</ueb-blueprint>
|
||||
```
|
||||
|
||||
@@ -4,12 +4,9 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>UE Blueprint</title>
|
||||
<link rel="stylesheet" href="dist/css/ueblueprint-node-value-type-color.css">
|
||||
<link rel="stylesheet" href="dist/css/ueb-style.css">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
ueb-blueprint {
|
||||
--ueb-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -184,6 +184,7 @@ export default class IEntity {
|
||||
} else if (attributeType instanceof ComputedType) {
|
||||
return undefined
|
||||
} else {
|
||||
// @ts-expect-error
|
||||
return () => new attributeType()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,6 +213,7 @@ export default class PinEntity extends IEntity {
|
||||
|
||||
getDefaultValue(maybeCreate = false) {
|
||||
if (this.DefaultValue === undefined && maybeCreate) {
|
||||
// @ts-expect-error
|
||||
this.DefaultValue = new (this.getEntityType(true))()
|
||||
}
|
||||
return this.DefaultValue
|
||||
|
||||
@@ -74,6 +74,7 @@ export default class ObjectSerializer extends Serializer {
|
||||
attributeSeparator,
|
||||
trailingSeparator,
|
||||
attributeValueConjunctionSign,
|
||||
// @ts-expect-error
|
||||
key => entity[key] instanceof ObjectEntity ? "" : attributeKeyPrinter(key)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ export default class Serializer {
|
||||
|
||||
/** @param {T} value */
|
||||
write(value, insideString = false) {
|
||||
// @ts-expect-error
|
||||
return this.doWrite(value, insideString)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user