Comments (8)
@AndriyShpyra What's the size of text block you're mentioning? Can you provide code snippet? Also, what platform are you running Lightning on?
from lightning.
Size of text block depends on the response from an api, it can be around 600 000 symbols.
During the development process Lightning is being run mostly on chrome browser
class TextDemo extends lng.Application { _init() { this.patch({ x: 50, y: 50, Text: { text: { wordWrapWidth: 600, textColor: 0xffff00ff, fontSize: 36, text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Cursus turpis massa tincidunt dui ut ornare lectus sit amet. Augue ut lectus arcu bibendum at varius vel pharetra vel. Amet mattis vulputate enim nulla aliquet. Ac turpis egestas integer eget aliquet. Potenti nullam ac tortor vitae purus faucibus. Duis ut diam quam nulla. Posuere lorem ipsum dolor sit. Faucibus ornare suspendisse sed nisi. Scelerisque felis imperdiet proin fermentum leo vel orci. Faucibus in ornare quam viverra orci .....and a lot more text}
}
})
}
}
const options = {stage: {w: window.innerWidth, h: window.innerHeight, useImageWorker: false}};
const app = new TextDemo(options);
document.body.appendChild(app.stage.getCanvas());`
__
from lightning.
Probably you hit the max texture size and the texture will not be rendered, a valid solution would to split the text up in chunks and use some form of pagination
from lightning.
@AndriyShpyra Can we close the ticket?
from lightning.
We actually could try solving it on Lightning's end, for example by doing text chunking text into smaller pieces and composing several textures. This could be increasingly a problem, because different platforms have different GL capabilities and code that works on desktop browser or even existing low end platforms would break when hitting target platform.
from lightning.
Good suggestion, but what are we going to do after all the textures are created? We would end up with a batch of textures and only one them would be visible. We then need to offer additional functionality to display one after the other, and the question is if it will match the expectation.
We can create some configurable text components for the SDK like scroller / paging.
from lightning.
Thanks for help!
It would be cool if such functionality was added to Lightning
from lightning.
I analysed the possibilities and unfortunately creating complex text component would not be a good idea.
For one, many developers are used to current way of representing text via texture and introducing different way (e.g. text element) would introduce unnecessary confusion.
Additionally, it would probably take some time before such element would become stable and bug free. It is good candidate for next major release but not as a feature for current one.
And to answer your initial question, to avoid such bugs from occuring it is recommended to create textures that do not exceed viewport dimensions.
from lightning.
Related Issues (20)
- Regression with advanced text renderer and line height. HOT 1
- Regression with rendering text that uses normal spaces HOT 3
- Tree shaking HOT 3
- Unable to run lightning on QT5 browser HOT 3
- Bind attempt of recently deleted buffers and textures
- Alpha channel heuristic when not using ImageWorker doesn't deal with uppercase file extensions HOT 6
- Unnecessary allocations per frame HOT 3
- Enable to use webgl2 when webgl is not enabled in device. HOT 2
- Calling `chidlList.add` to add an element that's already in the childList throws "out of bounds" error
- Issue with dynamic width and height HOT 4
- Font renderer smoothness issues on EOS STBs HOT 1
- Duplicate call for `_cleanupLookupMap`
- Draw function crashing because of undefined texture
- Version 2.12.1 not including typescript types HOT 4
- Double texture freeing bug
- Text Truncated with advancedRenderer but Ellipsis Included in New Line
- Wrong calculation for `getRoundRect` stroke width HOT 2
- Lightning Core > 2.11.0 Unsupported on older browsers HOT 2
- Unable to use `monospace` system font HOT 1
- Arabic Text with English Numbers Not Rendering Correctly in RTL Format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning.