zoukankan      html  css  js  c++  java
  • 关于Cocos2d-x中字体的使用

    1.如果使用的是系统自带的

    static Label* createWithSystemFont ( const std::string & text,
            const std::string & font,
            float fontSize,
            const Size & dimensions = Size::ZERO,
            TextHAlignment hAlignment = TextHAlignment::LEFT,
            TextVAlignment vAlignment = TextVAlignment::TOP
    )

    auto labelscore = Label::createWithSystemFont(score, "Arial", 72);

    2.如果是使用的是自己下载来的字体

    static Label* createWithTTF ( const std::string & text,
      const std::string & fontFilePath,
      float fontSize,
      const Size & dimensions = Size::ZERO,
      TextHAlignment hAlignment = TextHAlignment::LEFT,
      TextVAlignment vAlignment = TextVAlignment::TOP

    auto labelscore = Label::createWithTTF(score, "fonts/Marker Felt.ttf", 36);

  • 相关阅读:
    获取ip地址,
    手机div侧滑删除
    swiper左右选项卡滑动
    table-cell使用
    返回和刷新
    电脑浏览器计算高度和宽度
    css 空格
    时间js
    Nodejs仿Apache的部分功能
    Nodejs中的JavaScript
  • 原文地址:https://www.cnblogs.com/HangZhe/p/6130850.html
Copyright © 2011-2022 走看看