
lua
woshiwoxinheqiu
这个作者很懒,什么都没留下…
展开
-
lua中table.sort的坑
lua table.sort原创 2022-03-25 12:02:59 · 622 阅读 · 0 评论 -
log出bug时打印
localfunctionprintCallStack()localstartLevel=2--0表示getinfo本身,1表示调用getinfo的函数(printCallStack),2表示调用printCallStack的函数,可以想象一个getinfo(0级)在顶的栈.localmaxLevel=10--最大递归10层localerrorInfo=""forlevel=startLevel,maxLeveldo...原创 2020-11-06 16:29:09 · 179 阅读 · 0 评论 -
获取用户的ip相关数据
localfunctionsucHandler(response)print(response)localresult=json.decode(response)ifresultandresult.countryCode=="CN"thenprint('ipOK')elseprint('ipfail')end...原创 2020-07-13 11:23:14 · 150 阅读 · 0 评论 -
leetcode刷题53.maximum-sum-subarray-cn
来源:https://leetcode.com/problems/maximum-subarray/题目描述Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum....原创 2020-03-11 11:27:05 · 184 阅读 · 0 评论 -
leetcode刷题 26.remove-duplicates-from-sorted-array.
来源:https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/题目描述Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return...原创 2020-03-11 11:00:09 · 177 阅读 · 0 评论 -
leetcode刷题
来源:https://leetcode.com/problems/valid-parentheses/description描述Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input ...原创 2020-03-11 10:38:53 · 247 阅读 · 0 评论 -
cocos quick单纯截取某个节点的图
--node,要截图这个精灵的点-- params:{-- size:截取的大小-- bigger:外阔的宽度-- }--[[ --如果需要转动的话 node:setRotation(90) node:performWithDelay(function ( ) node:setRotation(0) end, 0.01)]]function MyApp:doC...原创 2019-09-24 14:32:46 · 303 阅读 · 0 评论 -
python 提取lua文件中的中文
#-*- coding: UTF-8 -*-import os# 遍历指定目录,显示目录下的所有文件名def eachFile(filepath): for root,dirs,files in os.walk(filepath): for file in files: luaFileName = os.path.join(root,fi...原创 2016-11-17 18:54:19 · 2761 阅读 · 1 评论 -
cocos2d英文数字无数换行问题
一个api搞定lable:setString("dddddddddddddddddddddddddddddddddddddddddddddddddddddddddd")lable:setLineBreakWithoutSpace(true)原创 2019-03-27 10:17:19 · 553 阅读 · 0 评论 -
cocos2d游戏横竖屏切换
functionGameLayer:resetView()self:setAnchorPoint(cc.p(0,0))localtargetPlatform=cc.Application:getInstance():getTargetPlatform()iftargetPlatform==cc.PLATFORM_OS_WINDOWSthenself:setScale(0....原创 2019-03-18 22:07:51 · 752 阅读 · 0 评论 -
纯Lua事件分发模块
来源:http://www.cocos2d-lua.org/doc/event/index.md PushCenter.lua可在https://github.com/u0u0/Lua-utils/blob/master/src/app/utils/PushCenter.lua获取热更新核心逻辑代码。初始化PushCenter 是单例设计的,为了避免被GC,导致内存存储的事件注...转载 2019-01-17 09:26:32 · 531 阅读 · 0 评论