当前位置: 首页 > news >正文

做那个的网站做网站 营业执照

做那个的网站,做网站 营业执照,信息系统管理工程师,网站模板能自己做吗Cocos2d-x 3.2 Lua演示样例FontTest#xff08;字体測试#xff09;本篇博客介绍Cocos2d-x 3.2中Lua測试项目中的FontTest样例#xff0c;主要使用了字体文件来创建我们想要的字体样式#xff1a;第一个參数为文本。第二參数为ttf字体文件#xff0c;第三个參数为字体大小… Cocos2d-x 3.2 Lua演示样例FontTest字体測试  本篇博客介绍Cocos2d-x 3.2中Lua測试项目中的FontTest样例主要使用了字体文件来创建我们想要的字体样式第一个參数为文本。第二參数为ttf字体文件第三个參数为字体大小第四个參数为块大小。第五个參数为文本横向对齐方式第六个慘为文本纵向对齐方式。样例效果图演示样例代码注单独文件不可执行详细可參考lua-tests)--4个标签的Tag local kTagLabel1 0 local kTagLabel2 1 local kTagLabel3 2 local kTagLabel4 3-- 字体列表 local fontList {fonts/A Damn Mess.ttf,fonts/Abberancy.ttf,fonts/Abduction.ttf,fonts/Paint Boy.ttf,fonts/Schwarzwald Regular.ttf,fonts/Scissor Cuts.ttf }local fontCount table.getn(fontList) -- 获得表元素个数 cclog(font count ..fontCount)local vAlignIdx 1 local verticalAlignment {cc.VERTICAL_TEXT_ALIGNMENT_TOP, -- 对齐顶部cc.VERTICAL_TEXT_ALIGNMENT_CENTER, -- 居中对齐cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM, -- 底部对齐 }local vAlignCount table.getn(verticalAlignment)--[[显示字体]]-- local function showFont(ret, pFont)cclog(vAlignIdx..vAlignIdx)local s cc.Director:getInstance():getWinSize()-- 窗体大小local blockSize cc.size(s.width/3, 200)-- 块大小local fontSize 26--字体大小-- 依据Tag移除子节点ret:removeChildByTag(kTagLabel1, true)ret:removeChildByTag(kTagLabel2, true)ret:removeChildByTag(kTagLabel3, true)ret:removeChildByTag(kTagLabel4, true)-- static Label* createWithTTF(const std::string text, const std::string fontFile, float fontSize, const Size dimensions Size::ZERO,--TextHAlignment hAlignment TextHAlignment::LEFT,TextVAlignment vAlignment TextVAlignment::TOP)-- 第一个參数为文本第二个參数为字体样式第三个參数为字体大小第四个參数为块大小第五个參数为文本横向对齐。第六个參数为文本纵向对齐local top cc.Label:createWithTTF(pFont, pFont, 24)local left cc.Label:createWithTTF(alignment left, pFont, fontSize,blockSize, cc.TEXT_ALIGNMENT_LEFT, verticalAlignment[vAlignIdx])local center cc.Label:createWithTTF(alignment center, pFont, fontSize,blockSize, cc.TEXT_ALIGNMENT_CENTER, verticalAlignment[vAlignIdx])local right cc.Label:createWithTTF(alignment right, pFont, fontSize,blockSize, cc.TEXT_ALIGNMENT_RIGHT, verticalAlignment[vAlignIdx])-- 创建颜色层第一个參数是颜色第二个參数为宽度第三个參数为高度local leftColor cc.LayerColor:create(cc.c4b(100, 100, 100, 255), blockSize.width, blockSize.height)local centerColor cc.LayerColor:create(cc.c4b(200, 100, 100, 255), blockSize.width, blockSize.height)local rightColor cc.LayerColor:create(cc.c4b(100, 100, 200, 255), blockSize.width, blockSize.height)-- 忽略锚点对位置的影响 假设为true。锚点为(0,0)leftColor:ignoreAnchorPointForPosition(false)centerColor:ignoreAnchorPointForPosition(false)rightColor:ignoreAnchorPointForPosition(false)top:setAnchorPoint(cc.p(0.5, 1)) -- 设置锚点(0.5,1)left:setAnchorPoint(cc.p(0,0.5))leftColor:setAnchorPoint(cc.p(0,0.5))center:setAnchorPoint(cc.p(0,0.5))centerColor:setAnchorPoint(cc.p(0,0.5))right:setAnchorPoint(cc.p(0,0.5))rightColor:setAnchorPoint(cc.p(0,0.5))top:setPosition(cc.p(s.width/2,s.height-20)) -- 设置显示位置left:setPosition(cc.p(0,s.height/2))leftColor:setPosition(left:getPosition())center:setPosition(cc.p(blockSize.width, s.height/2))centerColor:setPosition(center:getPosition())right:setPosition(cc.p(blockSize.width*2, s.height/2))rightColor:setPosition(right:getPosition())ret:addChild(leftColor, -1)ret:addChild(left, 0, kTagLabel1)ret:addChild(rightColor, -1)ret:addChild(right, 0, kTagLabel2)ret:addChild(centerColor, -1)ret:addChild(center, 0, kTagLabel3)ret:addChild(top, 0, kTagLabel4) endlocal isFirst true local originCreateLayer createTestLayer local function createTestLayer()if isFirst false thenif Helper.index 1 thenvAlignIdx vAlignIdx % vAlignCount 1endelseisFirst falseendlocal ret originCreateLayer()showFont(ret, fontList[Helper.index])return ret endfunction FontTestMain()cclog(FontTestMain)Helper.index 1vAlignIdx 1local scene cc.Scene:create()-- 创建方法表Helper.createFunctionTable {createTestLayer,createTestLayer,createTestLayer,createTestLayer,createTestLayer,createTestLayer}scene:addChild(createTestLayer()) -- 加入測试层scene:addChild(CreateBackMenuItem())--加入后退buttonreturn scene end转载于:https://www.cnblogs.com/gcczhongduan/p/5079904.html
http://www.zqtcl.cn/news/841204/

相关文章:

  • 科技设计公司网站模板下载网站建设计划 文库
  • 建设美食网站做的好的阅读类的网站有哪些
  • 全屏网站模板制作教程吴江建设局房产网站
  • 浠水网站建设漳州找人做网站要求哪些
  • 做网站需要前台和后台吗公众号制作要求
  • 做一个网站 如何盈利模式招聘网站排行榜2021
  • 免费做网站网站有人哪些c 网站开发网易云课堂百度云下载
  • 高端品牌网站设计欣赏扬中网站建设包括哪些
  • 手机怎么访问微网站网络运营商电话
  • 怎么成立网站战争局势最新消息
  • 嘉定网站设计制作报价crm系统营销
  • 一个网站做几个关键词怎么样子做网站
  • 关于做网站的创新创业策划书怎么进网站后台管理系统
  • 品牌型网站开发wap网站开发工具
  • 网站改版设计微信淘宝购物券网站是怎么做的
  • 网站建设基本流程心得网站设计开发报价
  • 泉州网站建设网站制作电商网站建设需要
  • 沈阳工程建设信息网深圳seo网站排名优化
  • wordpress仿dz长沙seo网站优化
  • 西宁做网站公司电话关键词快速排名怎么做
  • 昆山网站建设秦皇岛淘宝关键词推广
  • 建设娱乐网站的要求微网站开发多少钱
  • 海港区网站快排seo网站怎么添加流量
  • 肇庆做网站aspaccess做网站
  • 郑州网站建设索q479185700wordpress输出用户中心链接
  • 网站重要三要素网站建设 找vx cp5173
  • 河北网站开发价格三个字简洁的公司名称
  • 网站建设案例分析wordpress 页面固定
  • 杭州网站备案机械加工网站有哪些
  • 360网站运营wordpress 免费版广告