![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
three.texttexture
Advanced tools
Readme
class THREE.TextTexture extends THREE.Texture
An instance of TextTexture
is a texture for the text writing.
npm i three.texttexture
import TextTexture from 'three.texttexture';
<script src="https://unpkg.com/three"></script>
<script src="https://unpkg.com/three.texttexture"></script>
The class TextTexture
will be available under the namespace THREE
.
new THREE.TextTexture({
align,
anisotropy,
createCanvas,
fillStyle,
fontFamily,
fontSize,
fontStyle,
fontVariant,
fontWeight,
format,
lineGap,
loadFontFace,
magFilter,
mapping,
minFilter,
padding,
strokeStyle,
strokeWidth,
text,
type,
wrapS,
wrapT,
})
let texture = new THREE.TextTexture({
fontFamily: '"Times New Roman", Times, serif',
fontSize: 32,
fontStyle: 'italic',
text: [
'Twinkle, twinkle, little star,',
'How I wonder what you are!',
'Up above the world so high,',
'Like a diamond in the sky.',
].join('\n'),
});
let material = new THREE.SpriteMaterial({
color: 0xffffbb,
map: texture,
});
let sprite = new THREE.Sprite(material);
sprite.scale.setX(texture.image.width / texture.image.height).multiplyScalar(10);
scene.add(sprite);
.text = ''
The text to write on the canvas.
.lines
read-only
The lines of the text.
.fontFamily = 'sans-serif'
The family of the font.
.fontSize = 16
The size of the font in pixels.
.fontWeight = 'normal'
The weight of the font. Possible values are 'normal'
, 'bold'
, 'bolder'
, 'lighter'
and '100'
to '900'
.
.fontVariant = 'normal'
The variant of the font. Possible values are 'normal'
and 'small-caps'
.
.fontStyle = 'normal'
The style of the font. Possible values are 'normal'
, 'italic'
and 'oblique'
.
.font
read-only
The combined properties of the font.
.fillStyle = '#fff'
The fill color or the style of the characters of the text.
.strokeWidth = 0
The stroke width of the characters of the text. The pixels are calculated relative to the font size.
.strokeStyle = '#000'
The stroke color or the style of the characters of the text.
.align = 'center'
The horizontal alignment of the text. Possible values are 'center'
, 'left'
and 'right'
.
.lineGap = 0.15
The vertical distance between the lines of the text. The pixels are calculated relative to the font size.
.padding = 0.25
The space around the content. The pixels are calculated relative to the font size.
.createCanvas()
Creates a new Canvas
instance.
.loadFontFace(family, style, variant, weight)
Forces a font face to be loaded.
Provide custom loadFontFace
function to support older browsers.
loadFontFace(family, style, variant, weight) {
return (new FontFaceObserver(family, {style, weight})).load();
}
FAQs
A texture with the drawn text.
The npm package three.texttexture receives a total of 138 weekly downloads. As such, three.texttexture popularity was classified as not popular.
We found that three.texttexture demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.