Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TNGD_CaveCruiser
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
TNGD_CaveCruiser
Commits
5c2ffb34
Commit
5c2ffb34
authored
Aug 21, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改
parent
d41df591
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
HTMLRichText.ts
assets/Component/HTMLRichText/HTMLRichText.ts
+15
-7
projectRule.query.json
preview-template/mock/projectX/projectRule.query.json
+1
-1
No files found.
assets/Component/HTMLRichText/HTMLRichText.ts
View file @
5c2ffb34
...
@@ -34,6 +34,11 @@ export class HTMLRichText extends Component {
...
@@ -34,6 +34,11 @@ export class HTMLRichText extends Component {
protected
start
()
{
protected
start
()
{
}
}
imgAssets
:
ImageAsset
=
null
;
t2d
:
Texture2D
=
new
Texture2D
();
sf
:
SpriteFrame
=
new
SpriteFrame
();
async
setTxt
(
html
:
string
)
{
async
setTxt
(
html
:
string
)
{
if
(
!
html
)
{
if
(
!
html
)
{
...
@@ -66,15 +71,12 @@ export class HTMLRichText extends Component {
...
@@ -66,15 +71,12 @@ export class HTMLRichText extends Component {
if
(
!
canvas
)
return
;
if
(
!
canvas
)
return
;
// document.body.appendChild(canvas);
this
.
imgAssets
=
new
ImageAsset
(
canvas
);
const
t2d
=
new
Texture2D
();
t2d
.
image
=
new
ImageAsset
(
canvas
);
const
sf
=
new
SpriteFrame
()
;
this
.
t2d
.
image
=
this
.
imgAssets
;
sf
.
texture
=
t2d
;
this
.
sf
.
texture
=
this
.
t2d
;
this
.
node
.
getComponent
(
Sprite
).
spriteFrame
=
sf
;
this
.
node
.
getComponent
(
Sprite
).
spriteFrame
=
this
.
sf
;
this
.
node
.
getComponent
(
UITransform
).
setContentSize
(
canvas
.
width
,
canvas
.
height
);
this
.
node
.
getComponent
(
UITransform
).
setContentSize
(
canvas
.
width
,
canvas
.
height
);
...
@@ -82,6 +84,12 @@ export class HTMLRichText extends Component {
...
@@ -82,6 +84,12 @@ export class HTMLRichText extends Component {
}
}
onDestroy
()
{
this
.
imgAssets
.
destroy
();
this
.
t2d
.
destroy
();
this
.
sf
.
destroy
();
}
}
}
preview-template/mock/projectX/projectRule.query.json
View file @
5c2ffb34
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment