Migrte lua script files

This commit is contained in:
halx99 2022-08-15 16:28:32 +08:00
parent b580991236
commit 6de08175bb
10 changed files with 52 additions and 52 deletions

View File

@ -4,7 +4,7 @@ end
local json = require 'cjson' local json = require 'cjson'
require "cocos.cocostudio.StudioConstants" require "axys.cocostudio.StudioConstants"
function ccs.sendTriggerEvent(event) function ccs.sendTriggerEvent(event)
local triggerObjArr = ccs.TriggerMng.getInstance():get(event) local triggerObjArr = ccs.TriggerMng.getInstance():get(event)

View File

@ -29,30 +29,30 @@ printInfo("")
printInfo("# DEBUG = " .. DEBUG) printInfo("# DEBUG = " .. DEBUG)
printInfo("#") printInfo("#")
device = require("cocos.framework.device") device = require("axys.framework.device")
display = require("cocos.framework.display") display = require("axys.framework.display")
transition = require("cocos.framework.transition") transition = require("axys.framework.transition")
require("cocos.framework.extends.NodeEx") require("axys.framework.extends.NodeEx")
require("cocos.framework.extends.SpriteEx") require("axys.framework.extends.SpriteEx")
require("cocos.framework.extends.LayerEx") require("axys.framework.extends.LayerEx")
require("cocos.framework.extends.MenuEx") require("axys.framework.extends.MenuEx")
if ccui then if ccui then
require("cocos.framework.extends.UIWidget") require("axys.framework.extends.UIWidget")
require("cocos.framework.extends.UICheckBox") require("axys.framework.extends.UICheckBox")
require("cocos.framework.extends.UIEditBox") require("axys.framework.extends.UIEditBox")
require("cocos.framework.extends.UIListView") require("axys.framework.extends.UIListView")
require("cocos.framework.extends.UIPageView") require("axys.framework.extends.UIPageView")
require("cocos.framework.extends.UIScrollView") require("axys.framework.extends.UIScrollView")
require("cocos.framework.extends.UISlider") require("axys.framework.extends.UISlider")
require("cocos.framework.extends.UITextField") require("axys.framework.extends.UITextField")
end end
require("cocos.framework.package_support") require("axys.framework.package_support")
-- register the build-in packages -- register the build-in packages
cc.register("event", require("cocos.framework.components.event")) cc.register("event", require("axys.framework.components.event"))
-- export global variable -- export global variable
local __g = _G local __g = _G

View File

@ -43,9 +43,9 @@ ccexp = axexp
ccui = axui ccui = axui
ccb = axb ccb = axb
require "cocos.cocos2d.Cocos2d" require "axys.cocos2d.Cocos2d"
require "cocos.cocos2d.Cocos2dConstants" require "axys.cocos2d.Cocos2dConstants"
require "cocos.cocos2d.functions" require "axys.cocos2d.functions"
__G__TRACKBACK__ = function(msg) __G__TRACKBACK__ = function(msg)
local msg = debug.traceback(msg, 3) local msg = debug.traceback(msg, 3)
@ -55,57 +55,57 @@ end
-- cocosstudio -- cocosstudio
if nil ~= ccs then if nil ~= ccs then
require "cocos.cocostudio.CocoStudio" require "axys.cocostudio.CocoStudio"
end end
-- ui -- ui
if nil ~= ccui then if nil ~= ccui then
require "cocos.ui.GuiConstants" require "axys.ui.GuiConstants"
end end
-- extensions -- extensions
require "cocos.extension.ExtensionConstants" require "axys.extension.ExtensionConstants"
-- network -- network
require "cocos.network.NetworkConstants" require "axys.network.NetworkConstants"
-- Spine -- Spine
if nil ~= sp then if nil ~= sp then
require "cocos.spine.SpineConstants" require "axys.spine.SpineConstants"
end end
-- require "cocos.cocos2d.deprecated" -- require "axys.cocos2d.deprecated"
-- Lua extensions -- Lua extensions
require "cocos.cocos2d.bitExtend" require "axys.cocos2d.bitExtend"
-- CCLuaEngine -- CCLuaEngine
-- require "cocos.cocos2d.DeprecatedCocos2dClass" -- require "axys.cocos2d.DeprecatedCocos2dClass"
-- require "cocos.cocos2d.DeprecatedCocos2dEnum" -- require "axys.cocos2d.DeprecatedCocos2dEnum"
-- require "cocos.cocos2d.DeprecatedCocos2dFunc" -- require "axys.cocos2d.DeprecatedCocos2dFunc"
-- register_cocostudio_module -- register_cocostudio_module
-- if nil ~= ccs then -- if nil ~= ccs then
-- require "cocos.cocostudio.DeprecatedCocoStudioClass" -- require "axys.cocostudio.DeprecatedCocoStudioClass"
-- require "cocos.cocostudio.DeprecatedCocoStudioFunc" -- require "axys.cocostudio.DeprecatedCocoStudioFunc"
-- end -- end
-- register_extension_module -- register_extension_module
-- require "cocos.extension.DeprecatedExtensionClass" -- require "axys.extension.DeprecatedExtensionClass"
-- require "cocos.extension.DeprecatedExtensionEnum" -- require "axys.extension.DeprecatedExtensionEnum"
-- require "cocos.extension.DeprecatedExtensionFunc" -- require "axys.extension.DeprecatedExtensionFunc"
-- register_network_module -- register_network_module
-- require "cocos.network.DeprecatedNetworkClass" -- require "axys.network.DeprecatedNetworkClass"
-- require "cocos.network.DeprecatedNetworkEnum" -- require "axys.network.DeprecatedNetworkEnum"
-- require "cocos.network.DeprecatedNetworkFunc" -- require "axys.network.DeprecatedNetworkFunc"
-- register_ui_module -- register_ui_module
-- if nil ~= ccui then -- if nil ~= ccui then
-- require "cocos.ui.DeprecatedUIEnum" -- require "axys.ui.DeprecatedUIEnum"
-- require "cocos.ui.DeprecatedUIFunc" -- require "axys.ui.DeprecatedUIFunc"
-- end -- end
-- physics3d -- physics3d
require "cocos.physics3d.physics3d-constants" require "axys.physics3d.physics3d-constants"
if AX_USE_FRAMEWORK then if AX_USE_FRAMEWORK then
require "cocos.framework.init" require "axys.framework.init"
end end

View File

@ -1,5 +1,5 @@
require "config" require "config"
require "cocos.init" require "axys.init"
local function main() local function main()
require("app.MyApp"):create():run() require("app.MyApp"):create():run()

View File

@ -1,4 +1,4 @@
require "cocos.init" require "axys.init"
require "ComponentTest/gameoverscene" require "ComponentTest/gameoverscene"
local scene = { local scene = {

View File

@ -63,7 +63,7 @@ local function LuaBridgeLayer()
if (cc.PLATFORM_OS_ANDROID == targetPlatform) then if (cc.PLATFORM_OS_ANDROID == targetPlatform) then
local args = { 2 , 3} local args = { 2 , 3}
local sigs = "(II)I" local sigs = "(II)I"
local luaj = require "cocos.cocos2d.luaj" local luaj = require "axys.cocos2d.luaj"
local className = "com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest" local className = "com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest"
local ok,ret = luaj.callStaticMethod(className,"addTwoNumbers",args,sigs) local ok,ret = luaj.callStaticMethod(className,"addTwoNumbers",args,sigs)
if not ok then if not ok then
@ -102,7 +102,7 @@ local function LuaBridgeLayer()
subtitleLabel:setString("See the console.") subtitleLabel:setString("See the console.")
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or (cc.PLATFORM_OS_MAC == targetPlatform) then if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or (cc.PLATFORM_OS_MAC == targetPlatform) then
local args = { num1 = 2 , num2 = 3 } local args = { num1 = 2 , num2 = 3 }
local luaoc = require "cocos.cocos2d.luaoc" local luaoc = require "axys.cocos2d.luaoc"
local className = "LuaObjectCBridgeTest" local className = "LuaObjectCBridgeTest"
local ok,ret = luaoc.callStaticMethod(className,"addTwoNumbers",args) local ok,ret = luaoc.callStaticMethod(className,"addTwoNumbers",args)
if not ok then if not ok then
@ -138,7 +138,7 @@ local function LuaBridgeLayer()
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or (cc.PLATFORM_OS_MAC == targetPlatform) then if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or (cc.PLATFORM_OS_MAC == targetPlatform) then
local args = {name = "jett" ,method = "call OC"} local args = {name = "jett" ,method = "call OC"}
local args_tab = {tab = args , name = "table_test"} local args_tab = {tab = args , name = "table_test"}
local luaoc = require "cocos.cocos2d.luaoc" local luaoc = require "axys.cocos2d.luaoc"
local className = "LuaObjectCBridgeTest" local className = "LuaObjectCBridgeTest"
local ok,ret = luaoc.callStaticMethod(className,"printLuaTableToDictionary",args_tab) local ok,ret = luaoc.callStaticMethod(className,"printLuaTableToDictionary",args_tab)

View File

@ -1,4 +1,4 @@
require "cocos.spine.SpineConstants" require "axys.spine.SpineConstants"
local SpineTestLayerNormal = class("SpineTestLayerNormal",function() local SpineTestLayerNormal = class("SpineTestLayerNormal",function()
return cc.Layer:create() return cc.Layer:create()

View File

@ -1,4 +1,4 @@
require "cocos.3d.3dConstants" require "axys.3d.3dConstants"
local size = cc.Director:getInstance():getWinSize() local size = cc.Director:getInstance():getWinSize()
local scheduler = cc.Director:getInstance():getScheduler() local scheduler = cc.Director:getInstance():getScheduler()

View File

@ -1,4 +1,4 @@
require "cocos.3d.3dConstants" require "axys.3d.3dConstants"
---------------------------------------- ----------------------------------------
----TerrainSimple ----TerrainSimple

View File

@ -10,7 +10,7 @@ end
---------------- ----------------
-- run -- run
AX_USE_DEPRECATED_API = true AX_USE_DEPRECATED_API = true
require "cocos.init" require "axys.init"
local director = cc.Director:getInstance() local director = cc.Director:getInstance()
local glView = director:getOpenGLView() local glView = director:getOpenGLView()