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

Update preloaded_font.js #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

chongma
Copy link

@chongma chongma commented Apr 15, 2022

I couldn't get the example to work for the version of three I was using (6.4.1) by accessing the TextureLoader from source. I had to make these changes. The paths might not be right, but you can get the gist

I couldn't get the example to work for the version of three I was using (6.4.1) by accessing the TextureLoader from source.  I had to make these changes.  The paths might not be right, but you can get the gist
@swingingtom
Copy link
Collaborator

Hi @chongma , thank you for PR this.

I tried it, but it don't work anymore. It cannot load the png asset file
image

I could only guess that it might be some webpack issue as you had to move from

// file-loaded by webpack
import FontImage from './assets/Roboto-msdf.png';

to

// not file-loaded by webpack
const texture = new THREE.TextureLoader().load('./assets/Roboto-msdf.png')

From v6.3.2 to v6.4.0 webpack dependency has been updated to version 5.
Could you try to npm install and then npm start again ?

One thing to note, I would anyway support the change from

import { TextureLoader } from 'three/src/loaders/TextureLoader.js';
// [...]
const textureLoader = new TextureLoader();

to

// [...]
const textureLoader = new THREE.TextureLoader();

as THREE has been fully imported, and then TextureLoader is already part of it 👍

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

Successfully merging this pull request may close these issues.

3 participants