Giter VIP home page Giter VIP logo

Comments (9)

stubma avatar stubma commented on July 4, 2024

嗯, 貌似是在ios上忘了考虑屏幕的retina缩放, 导致ios上有时显示的图标大于android上的, 这是个bug需要改. 至于可以任意对齐, 算是个新功能, 应该可以加

from cocos2dx-better.

stubma avatar stubma commented on July 4, 2024

现在android和ios上的内嵌图片表现的是一样大了, 测试了contentScaleFactor为1或者不为1的情况, perfect.

from cocos2dx-better.

zcgit avatar zcgit commented on July 4, 2024

perfect!!!马上测试。

from cocos2dx-better.

stubma avatar stubma commented on July 4, 2024

任意对齐功能不太好弄, 原因是richlabel支持任意字体, 也就是说一行里可能有多种字体, 这意味着如果要支持任意对齐, 在决定图像位置的时候就必须知道行高, 但是图像大小本身又是可能影响行高的. 这是个死锁的情况了, 除非一行里只有一种字体, 但是对于richlabel来说, 一行里只有一种字体是个不完美的假设. 另外, android和ios对于内嵌图片的渲染时间不同, 也带来了很多麻烦, 所以暂时不打算支持任意对齐.

from cocos2dx-better.

zcgit avatar zcgit commented on July 4, 2024

不过说实话,我们目前一行里有多种字体很少,按百分比来说不到5%,所以咱们可以判断,如果字符串中没有多个size标签,可以支持任意对齐。

from cocos2dx-better.

stubma avatar stubma commented on July 4, 2024

这种基于一个假设才能做的特性意义不大, 可以用别的方式满足你的需求。可以支持一个offsety属性,表示图像在y轴上的偏移量, 这样也可以满足你的场景,而且不依赖于行高,是更通用的方案。偏移量是相对于baseline的,不管一行有多少字体,baseline都是一样的.

from cocos2dx-better.

stubma avatar stubma commented on July 4, 2024

目前还有问题, 大小在w, h的时候还是不对, 看起来不应该考虑retina屏幕缩放, 经过测试后, ios已经ok, android有点麻烦, 正在继续调试, 继续等待吧

from cocos2dx-better.

zcgit avatar zcgit commented on July 4, 2024

嗯,我也测试了,android确实有问题。有scale的时候也是不对。

from cocos2dx-better.

stubma avatar stubma commented on July 4, 2024

终于对了, 测试了各种组合情况, 感觉ok了.

from cocos2dx-better.

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.