Masking with text
See original GitHub issueWe want to use text as a mask for an image. Something like this:
As I understand it, PIXI renders text to an image but we need a PIXI.Graphics object to do a mask. Is that correct? If so, does anyone know how I could turn text into a Graphics
?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
2 Ways Mask with Text in Photoshop - From Beginner to ...
Mask 2 – · 1.We have an image and a text layer. Move the text layer below the image layer. · 2. Hold...
Read more >7 Beautiful Text Masks - How to WOW with Images in Text - Easil
How to Create Images in Text with 'Text Masks' · #1 Create an image in text over a flat background color · #2...
Read more >Make a Text Mask | How to Fill Your Image With ... - PicMonkey
Learn how to easily make text masks in PicMonkey, and fill your text with images, video, textures, and more. Start designing for free...
Read more >How to Create a Text Mask in Canva - Blogging Guide
Text masking (also known as “knockout text”) is a technique allowing designers to display images, gradients, patterns, and even videos ...
Read more >Learn How To Add A Layer Mask To Text In Adobe Photoshop
Applying Layer Masks in Adobe Photoshop can have many great benefits, especially when working with typography. Bring an image to life by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Pixi masks use alpha and red channels. Your text is black, so its 0 by red => no mask.
https://jsfiddle.net/Hackerham/s7hh0590/3/ - it works for White text just fine.
Can i join here? i have read @jhollingworth code and try to do it by my way. however my code like this
var app = new PIXI.Application(800, 600, { transparent: true });
document.getElementById('container').appendChild(app.view);
PIXI.loader
.add('godzilla','https://i.kinja-img.com/gawker-media/image/upload/s--fbE5h4t0--/c_scale,fl_progressive,q_80,w_800/1501840081290294050.jpg')
.load(setup_B);
var style = new PIXI.TextStyle({
fontFamily: 'Arial',
fontSize: 200,
fontWeight: 'bold',
});
function setup_A()
{
var texture = PIXI.loader.resources.godzilla.texture;
var godzilla = new PIXI.Sprite(texture);
var text = new PIXI.Text('Godzilla', style);
text.x = 0
text.y = 100
godzilla.width = 800;
godzilla.height = 449;
godzilla.mask = text
app.stage.addChild(godzilla);
text.updateText();
}
function setup_B()
{
var texture = PIXI.loader.resources.godzilla.texture;
var godzilla = new PIXI.Sprite(texture);
var text = new PIXI.Text('Godzilla', style);
text.x = 0
text.y = 100
godzilla.width = 800;
godzilla.height = 449;
text.mask = godzilla
app.stage.addChild(text);
text.updateText();
}
in setup_A, window show nothing , in setup_B, text.mask just show mono,not color. Have missing understanding something?