PIXI TEXT STYLE GENERATOR
GENERATE STYLE
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.5.1/pixi.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/css/bootstrap-colorpicker.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/css/bootstrap-colorpicker.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/img/bootstrap-colorpicker/alpha-horizontal.png"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/img/bootstrap-colorpicker/hue.png"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/js/bootstrap-colorpicker.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/img/bootstrap-colorpicker/saturation.png"></script>
<body>
<section id="title">
</section>
<section id="fontFamily">
<p class="text-info">fontFamily</p>
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">fontFamily
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">Arial</a></li>
<li><a href="#">other</a></li>
<li><a href="#">other googlewebfont</a></li>
</ul>
</section>
<section id="fontSize">
<p class="text-info">fontSize</p>
<input type="number" step="1" value="0" min="0" max="100"class="btn btn-default">
</section>
<section id="fontWeight">
<p class="text-info">fontWeight</p>
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">fontWeight
<span...
CSS
@import url(http://fonts.googleapis.com/css?family=Roboto:400,300);
@import url(http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css);
body {
padding: 30px 15px;
}
.range {
display: table;
position: relative;
height: 25px;
margin-top: 20px;
background-color: rgb(245, 245, 245);
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
.range input[type="range"] {
-webkit-appearance: none !important;
-moz-appearance: none !important;
-ms-appearance: none !important;
-o-appearance: none !important;
appearance: none !important;
display: table-cell;
width: 100%;
background-color: transparent;
height: 25px;
cursor: pointer;
}
.range input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none !important;
-moz-appearance: none !important;
-ms-appearance: none !important;
-o-appearance: none !important;
appearance: none !important;
width: 11px;
height: 25px;
color: rgb(255, 255, 255);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0px;
background-color: rgb(153, 153, 153);
}
.range input[type="range"]::-moz-slider-thumb {
-webkit-appearance: none !important;
-moz-appearance: none !important;
-ms-appearance: none !important;
-o-appearance: none !important;
appearance: none !important;
width: 11px;
height: 25px;
color: rgb(255, 255, 255);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0px;
background-color: rgb(153, 153, 153);
}
.range output {
display: table-cell;
padding: 3px 5px 2px;
min-width: 40px;
color: rgb(255, 255, 255);
background-color: rgb(153, 153, 153);
text-align: center;
text-decoration: none;
border-radius: 4px;
border-bottom-left-radius: 0;
...
JavaScript
var app = new PIXI.Application(400, 200, {backgroundColor: 0x1099bb});
document.body.appendChild(app.view);
var style = new PIXI.TextStyle({
fontFamily: 'Arial',
fontSize: 36,
fontStyle: 'italic',
fontWeight: 700,
fill: ['#ffffff', '#00ff99'], // gradient
stroke: '#4a1850',
strokeThickness: 5,
dropShadow: true,
dropShadowColor: '#000000',
dropShadowBlur: 4,
dropShadowAngle: Math.PI / 6,
dropShadowDistance: 6,
wordWrap: true,
wordWrapWidth: 440
});
var richText = new PIXI.Text('Rich text with a lot of options and across multiple lines', style);
richText.x = 10;
richText.y = 10;
app.stage.addChild(richText);