Giter VIP home page Giter VIP logo

Comments (6)

akira-cn avatar akira-cn commented on May 29, 2024

不清楚是否是windows或者edge环境问题,你如果换浏览器可以正常渲染吗?

from spritejs.

Thever avatar Thever commented on May 29, 2024

firfox 115.0 (64 位)上是可以正常显示的,我刚刚调整了label的lineheight,width和height,有的时候渲染正常,有时字体就会被切片或者扭曲渲染异常了,这个可能和浏览器有关系?
用原生canvas用 strokeText 设置相关属性渲染本地是正常的,会不会有什么底层的东西我没考虑到?

from spritejs.

Thever avatar Thever commented on May 29, 2024

补充:
官方文档 label 说明在chrome和edge浏览器中也存在渲染瑕疵(http://spritejs.com/#/zh-cn/block?id=%e6%96%87%e5%ad%97-label)

这里有一些截图方面查看:
Chrome 114.0.5735.199(正式版本) (64 位)
chrome

Edge 114.0.1823.67 (正式版本) (64 位)
edge

firfox 115.0 (64 位)
firefox

得空了请您看下,谢谢

from spritejs.

akira-cn avatar akira-cn commented on May 29, 2024

我的mac电脑上都没有问题,我没有windows环境,label渲染是用2D渲染之后再把内容绘制到webgl上的,确实不明白这块为啥会有问题。。有可能要用SDF绘制字体比较好,但是这需要比较大的建模工作量,现在短期估计实现不了。你的应用是不是固定文字的,看起来好像你只是显示一些字母和阿拉伯数字,你可以考虑换成bmfont方案,把英文和数字转成图片,然后用图替代label

from spritejs.

Thever avatar Thever commented on May 29, 2024

嗯,为了兼容性我PS了D1到D24的图片替换Label,可以正常展示,先当临时过渡方案保证效果了。感谢您百忙之中抽空回复~

from spritejs.

LiGaoLiang7 avatar LiGaoLiang7 commented on May 29, 2024

微信截图_20240425112710
官网这个例子在Win11系统中label显示有问题,鼠标划过文字就正常了,https://spritejs.com/demo/#/transforms
可以在代码中用定时器用重新设置一下label的颜色,显示就能正常

from spritejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.