Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add outline/shadow tags to markups #4302

Merged
merged 14 commits into from
Jun 8, 2022

Conversation

querielo
Copy link
Contributor

@querielo querielo commented Jun 7, 2022

Abstract: add outline/shadow tags to markups, so a user can set outline and shadow styles with markups.

Usage:

  • Outline
    [outline color="#ffffff" thickness="0.5"]Text[/outline]
  • Shadow
    [shadow color="#ffffff" offset="0.5"]Text[/shadow]
    [shadow color="#ffffff" offsetX="0.5" offsetY="0.5"]Text[/shadow]
  • color/outline/shadow tags can be intersected ([shadow]T[color]e[outline]x[/shadow]t[/color][/outline])
    [shadow color="#ffffff" offset="0.5"]T[color="#000000"]e[outline color="#ffffff" thickness="0.5"]x[/shadow]t[/color][/outline]

Note: since markups use attributes the MR can improve batching of text elements if enableMarkups is enabled. I'd like to share an example, but I don't know how to get PlayCanvas Engine build from Github Action. So, you need to build the engine locally.
Example:

Here is the profiling screenshot using Spectorjs
Screen Shot 2022-06-07 at 09 30 52

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@yaustar yaustar requested review from slimbuck, jpauloruschel and a team June 7, 2022 08:28
@yaustar yaustar added feature request area: ui UI related issue labels Jun 7, 2022
@slimbuck
Copy link
Member

slimbuck commented Jun 7, 2022

@querielo - this is just an epic PR, awesome!

Copy link
Contributor

@jpauloruschel jpauloruschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, thanks! Could you also add a few screenshots of this new feature in action and maybe some edge cases, in addition to the profiling one?

src/framework/components/element/system.js Outdated Show resolved Hide resolved
src/framework/components/element/text-element.js Outdated Show resolved Hide resolved
@querielo
Copy link
Contributor Author

querielo commented Jun 7, 2022

Great PR, thanks! Could you also add a few screenshots of this new feature in action and maybe some edge cases, in addition to the profiling one?

@jpauloruschel
Is it possible to take a build from Github actions and pass it into URL? Like this,
https://launch.playcanvas.com/1436584?ministats=true&use_local_engine=http://localhost:51000/playcanvas.dbg.js

@querielo
Copy link
Contributor Author

querielo commented Jun 7, 2022

Example:
[color="#00FF00"]T[shadow color="#0000FF" offset="1"]e[outline color="#00FFFF" thickness="1"]x[/color]t[/shadow][/outline]
Color: #FFFFFF
Outline color: #FF00FFFF
Outline thickness: 1
Shadow: #FF0000FF
Shadow offset: [0.5, -0.5]

Result:
Screen Shot 2022-06-07 at 14 41 10

@yaustar
Copy link
Contributor

yaustar commented Jun 7, 2022

Is it possible to take a build from Github actions and pass it into URL? Like this,
https://launch.playcanvas.com/1436584?ministats=true&use_local_engine=http://localhost:51000/playcanvas.dbg.js

I'm afraid not, the closest you can do (if you want to share a project) is to add the custom build of PlayCanvas into the project and set the loading type to be 'after engine'

The use_local_engine param only takes in URLs from localhost or code.playcanvas.com

@querielo
Copy link
Contributor Author

querielo commented Jun 7, 2022

Copy link
Contributor

@jpauloruschel jpauloruschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on UI System / TextElement side, but still needs another check on the shader + material side.

@willeastcott willeastcott merged commit 2bb4ff4 into playcanvas:main Jun 8, 2022
@willeastcott
Copy link
Contributor

Thanks so much for the contribution, @querielo! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants