GithubHelp home page GithubHelp logo

avatarchik / umarkup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ls9512/umarkup

0.0 0.0 0.0 13 KB

UMarkup is a simplified extension for Unity RichText Markup,It can enhance the text style of Log / UGUI Text / GUI Label, also for TextMeshPro.

License: MIT License

C# 100.00%

umarkup's Introduction

UMarkup

UMarkup is a simplified extension for Unity RichText Markup,It can enhance the text style of Log / UGUI Text / GUI Label, also for TextMeshPro.

topLanguage size issue license last 996.icu

1. How to use

1.1. Extension Style

var str1 = "[Markup Test 1]"
	// <size=15><b><color=green>Complex Style</color></b></size>
	+ " Complex Style".ToMarkup(UMarkup.Green, UMarkup.Bold, UMarkup.Size(15))
	// <color=#ffffff>White</color>
	+ " White".ToMarkup(Color.white)
	// <i>Italics</i>
	+ " Italics".ToMarkup(UMarkup.Italic)
	// <b>Bold</b>
	+ " Bold".ToMarkup(UMarkup.Bold);
Debug.Log(str1);

1.2. Method Style

var str2 = "[Markup Test 2]"
	// <size=15><b><color=green>Complex Style</color></b></size>
	+ UMarkup.Create(" Complex Style", UMarkup.Yellow, UMarkup.Italic, UMarkup.Size(12))
    // <color=#ffffff>White</color>
    + UMarkup.Create(" White", UMarkup.Color(Color.white))
	// <i>Italics</i>
	+ UMarkup.Create(" Italics", UMarkup.Italic)
	// <b>Bold</b>
	+ UMarkup.Create(" Bold", UMarkup.Bold);
Debug.Log(str2);

2. Supported Tags

2.1. Font Sytle

  • Size
  • Bold
  • Italic

2.2. Color Sytle

  • Red
  • Green
  • Blue
  • White
  • Blank
  • Yellow
  • Cyan
  • Magenta
  • Gray
  • Clear
  • Color

2.3. Other

  • Material
  • Quad

3. Extension for TextMeshPro

You can also use UMarkup to build strings for TextMeshPro. The supported tag styles are as follows:

3.1. Supported Tags

  • AlignLeft
  • AlignCenter
  • AlignRight
  • Alpha
  • CharacterSpace
  • Font
  • Indentation
  • LineHeight
  • LineIndentation
  • Link
  • Lowercase
  • Uppercase
  • AllCaps
  • SmallCaps
  • Margin
  • Mark
  • MonoSpace
  • Noparse
  • NoBreakingSpaces
  • PageBreak
  • HorizontalPosition
  • Size
  • HorizontalSpace
  • Sprite
  • Underline
  • Strikethrough
  • Style
  • Superscript
  • Subscript
  • VerticalOffset
  • Width

3.2. Supported Size Formart

  • Pixels
  • FontUnits
  • Percentages

umarkup's People

Contributors

ls9512 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.