update luabinding scripts

This commit is contained in:
dualface 2014-10-11 01:27:12 +08:00
parent 68f71b3df4
commit 20cbbfdbe5
21 changed files with 259 additions and 209 deletions

View File

@ -1,3 +1,4 @@
cc = cc or {}
function cc.clampf(value, min_inclusive, max_inclusive)

View File

@ -1,3 +1,4 @@
cc = cc or {}
cc.SPRITE_INDEX_NOT_INITIALIZED = 0xffffffff

View File

@ -1,5 +1,4 @@
require "Cocos2dConstants.lua"
require "OpenglConstants.lua"
--Enums will be deprecated,begin
_G.kCCTextAlignmentLeft = cc.TEXT_ALIGNMENT_LEFT
_G.kCCTextAlignmentRight = cc.TEXT_ALIGNMENT_RIGHT

View File

@ -1,10 +1,9 @@
require "Cocos2d.lua"
--tip
local function deprecatedTip(old_name,new_name)
print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
end
--functions of CCDirector will be deprecated,begin
local CCDirectorDeprecated = { }
function CCDirectorDeprecated.sharedDirector()

View File

@ -1,3 +1,4 @@
local dp_initialized = false
local dp_shader = nil
local dp_colorLocation = -1

View File

@ -1,6 +1,5 @@
require "OpenglConstants"
gl = gl or {}
if not gl then return end
--Create functions
function gl.createTexture()
@ -296,4 +295,3 @@ end
function gl.glNodeCreate()
return cc.GLNode:create()
end

View File

@ -1,5 +1,5 @@
--Encapsulate opengl constants.
gl = gl or {}
if not gl then return end
gl.GCCSO_SHADER_BINARY_FJ = 0x9260
gl._3DC_XY_AMD = 0x87fa

View File

@ -2,6 +2,7 @@
bit = bit or {}
bit.data32 = {}
for i=1,32 do
bit.data32[i]=2^(32-i)
end

View File

@ -1,3 +1,4 @@
function clone(object)
local lookup_table = {}
local function _copy(object)
@ -90,4 +91,3 @@ function performWithDelay(node, callback, delay)
node:runAction(sequence)
return sequence
end

View File

@ -1,3 +1,4 @@
--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects.
local M = {}
@ -105,16 +106,4 @@ function M.destroyInstance()
return cc.SimpleAudioEngine:destroyInstance()
end
local modename = "AudioEngine"
local proxy = {}
local mt = {
__index = M,
__newindex = function (t ,k ,v)
print("attemp to update a read-only table")
end
}
setmetatable(proxy,mt)
_G[modename] = proxy
package.loaded[modename] = proxy
AudioEngine = M

View File

@ -1,8 +1,12 @@
require "json"
require "extern"
if not json then
require "cocos.cocos2d.json"
end
ccs = ccs or {}
require "cocos.cocosstudio.StudioConstants"
function ccs.sendTriggerEvent(event)
local triggerObjArr = ccs.TriggerMng.getInstance():get(event)

View File

@ -1,5 +1,5 @@
ccs = ccs or {}
ccs = ccs or {}
ccs.MovementEventType = {
start = 0,

View File

@ -1,3 +1,4 @@
cc = cc or {}
cc.ControllerKey =

View File

@ -1,3 +1,4 @@
cc = cc or {}
cc.CONTROL_STATE_NORMAL = 1

View File

@ -0,0 +1,55 @@
require "cocos.cocos2d.Cocos2d"
require "cocos.cocos2d.Cocos2dConstants"
require "cocos.cocos2d.extern"
-- opengl
require "cocos.cocos2d.Opengl"
require "cocos.cocos2d.OpenglConstants"
-- cocosdenshion
require "cocos.cocosdenshion.AudioEngine"
-- cocosstudio
require "cocos.cocosstudio.CocosStudio"
-- ui
require "cocos.ui.GuiConstants"
-- extensions
require "cocos.extension.ExtensionConstants"
-- network
require "cocos.network.NetworkConstants"
if CC_USE_DEPRECATED_API then
-- CCLuaEngine
require "cocos.cocos2d.DeprecatedCocos2dClass"
require "cocos.cocos2d.DeprecatedCocos2dEnum"
require "cocos.cocos2d.DeprecatedCocos2dFunc"
-- register_cocostudio_module
require "cocos.cocosstudio.DeprecatedCocoStudioClass"
require "cocos.cocosstudio.DeprecatedCocoStudioFunc"
-- register_cocosbuilder_module
require "cocos.cocosbuilder.DeprecatedCocosBuilderClass"
-- register_cocosdenshion_module
require "cocos.cocosdenshion.DeprecatedCocosDenshionClass"
require "cocos.cocosdenshion.DeprecatedCocosDenshionFunc"
-- register_extension_module
require "cocos.extension.DeprecatedExtensionClass"
require "cocos.extension.DeprecatedExtensionEnum"
require "cocos.extension.DeprecatedExtensionFunc"
-- register_network_module
require "cocos.network.DeprecatedNetworkClass"
require "cocos.network.DeprecatedNetworkEnum"
require "cocos.network.DeprecatedNetworkFunc"
-- register_ui_moudle
require "cocos.ui.DeprecatedUIEnum"
require "cocos.ui.DeprecatedUIFunc"
end

View File

@ -1,3 +1,4 @@
cc = cc or {}
cc.WEBSOCKET_OPEN = 0
@ -10,7 +11,6 @@ cc.WEBSOCKET_STATE_OPEN = 1
cc.WEBSOCKET_STATE_CLOSING = 2
cc.WEBSOCKET_STATE_CLOSED = 3
cc.XMLHTTPREQUEST_RESPONSE_STRING = 0
cc.XMLHTTPREQUEST_RESPONSE_ARRAY_BUFFER = 1
cc.XMLHTTPREQUEST_RESPONSE_BLOB = 2

View File

@ -1,84 +1,83 @@
require("GuiConstants")
_G.LAYOUT_COLOR_NONE = ccui.LayoutBackGroundColorType.none
_G.LAYOUT_COLOR_SOLID = ccui.LayoutBackGroundColorType.solid
_G.LAYOUT_COLOR_GRADIENT = ccui.LayoutBackGroundColorType.gradient
LAYOUT_COLOR_NONE = ccui.LayoutBackGroundColorType.none
LAYOUT_COLOR_SOLID = ccui.LayoutBackGroundColorType.solid
LAYOUT_COLOR_GRADIENT = ccui.LayoutBackGroundColorType.gradient
_G.LAYOUT_ABSOLUTE = ccui.LayoutType.ABSOLUTE
_G.LAYOUT_LINEAR_VERTICAL = ccui.LayoutType.VERTICAL
_G.LAYOUT_LINEAR_HORIZONTAL = ccui.LayoutType.HORIZONTAL
_G.LAYOUT_RELATIVE = ccui.LayoutType.RELATIVE
LAYOUT_ABSOLUTE = ccui.LayoutType.ABSOLUTE
LAYOUT_LINEAR_VERTICAL = ccui.LayoutType.VERTICAL
LAYOUT_LINEAR_HORIZONTAL = ccui.LayoutType.HORIZONTAL
LAYOUT_RELATIVE = ccui.LayoutType.RELATIVE
_G.BRIGHT_NONE = ccui.BrightStyle.none
_G.BRIGHT_NORMAL = ccui.BrightStyle.normal
_G.BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight
BRIGHT_NONE = ccui.BrightStyle.none
BRIGHT_NORMAL = ccui.BrightStyle.normal
BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight
_G.UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType
_G.UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType
UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType
UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType
_G.TOUCH_EVENT_BEGAN = ccui.TouchEventType.began
_G.TOUCH_EVENT_MOVED = ccui.TouchEventType.moved
_G.TOUCH_EVENT_ENDED = ccui.TouchEventType.ended
_G.TOUCH_EVENT_CANCELED = ccui.TouchEventType.canceled
TOUCH_EVENT_BEGAN = ccui.TouchEventType.began
TOUCH_EVENT_MOVED = ccui.TouchEventType.moved
TOUCH_EVENT_ENDED = ccui.TouchEventType.ended
TOUCH_EVENT_CANCELED = ccui.TouchEventType.canceled
_G.SIZE_ABSOLUTE = ccui.SizeType.absolute
_G.SIZE_PERCENT = ccui.SizeType.percent
SIZE_ABSOLUTE = ccui.SizeType.absolute
SIZE_PERCENT = ccui.SizeType.percent
_G.POSITION_ABSOLUTE = ccui.PositionType.absolute
_G.POSITION_PERCENT = ccui.PositionType.percent
POSITION_ABSOLUTE = ccui.PositionType.absolute
POSITION_PERCENT = ccui.PositionType.percent
_G.CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected
_G.CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected
CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected
CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected
_G.CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected
_G.CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected
CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected
CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected
_G.LoadingBarTypeLeft = ccui.LoadingBarDirection.LEFT
_G.LoadingBarTypeRight = ccui.LoadingBarDirection.RIGHT
LoadingBarTypeLeft = ccui.LoadingBarDirection.LEFT
LoadingBarTypeRight = ccui.LoadingBarDirection.RIGHT
_G.LoadingBarTypeRight = ccui.SliderEventType.percent_changed
LoadingBarTypeRight = ccui.SliderEventType.percent_changed
_G.TEXTFIELD_EVENT_ATTACH_WITH_IME = ccui.TextFiledEventType.attach_with_ime
_G.TEXTFIELD_EVENT_DETACH_WITH_IME = ccui.TextFiledEventType.detach_with_ime
_G.TEXTFIELD_EVENT_INSERT_TEXT = ccui.TextFiledEventType.insert_text
_G.TEXTFIELD_EVENT_DELETE_BACKWARD = ccui.TextFiledEventType.delete_backward
TEXTFIELD_EVENT_ATTACH_WITH_IME = ccui.TextFiledEventType.attach_with_ime
TEXTFIELD_EVENT_DETACH_WITH_IME = ccui.TextFiledEventType.detach_with_ime
TEXTFIELD_EVENT_INSERT_TEXT = ccui.TextFiledEventType.insert_text
TEXTFIELD_EVENT_DELETE_BACKWARD = ccui.TextFiledEventType.delete_backward
_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollViewDir.none
_G.SCROLLVIEW_DIR_VERTICAL = ccui.ScrollViewDir.vertical
_G.SCROLLVIEW_DIR_HORIZONTAL = ccui.ScrollViewDir.horizontal
_G.SCROLLVIEW_DIR_BOTH = ccui.ScrollViewDir.both
SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollViewDir.none
SCROLLVIEW_DIR_VERTICAL = ccui.ScrollViewDir.vertical
SCROLLVIEW_DIR_HORIZONTAL = ccui.ScrollViewDir.horizontal
SCROLLVIEW_DIR_BOTH = ccui.ScrollViewDir.both
_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.scrollToTop
_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.scrollToBottom
_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.scrollToLeft
_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.scrollToRight
_G.SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.scrolling
_G.SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop
_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom
_G.SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft
_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight
SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.scrollToTop
SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.scrollToBottom
SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.scrollToLeft
SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.scrollToRight
SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.scrolling
SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop
SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom
SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft
SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight
_G.PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning
PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning
_G.PAGEVIEW_TOUCHLEFT = ccui.PVTouchDir.touch_left
_G.PAGEVIEW_TOUCHRIGHT = ccui.PVTouchDir.touch_right
PAGEVIEW_TOUCHLEFT = ccui.PVTouchDir.touch_left
PAGEVIEW_TOUCHRIGHT = ccui.PVTouchDir.touch_right
_G.LISTVIEW_DIR_NONE = ccui.ListViewDirection.none
_G.LISTVIEW_DIR_VERTICAL = ccui.ListViewDirection.vertical
_G.LISTVIEW_DIR_HORIZONTAL = ccui.ListViewDirection.horizontal
LISTVIEW_DIR_NONE = ccui.ListViewDirection.none
LISTVIEW_DIR_VERTICAL = ccui.ListViewDirection.vertical
LISTVIEW_DIR_HORIZONTAL = ccui.ListViewDirection.horizontal
_G.LISTVIEW_MOVE_DIR_NONE = ccui.ListViewMoveDirection.none
_G.LISTVIEW_MOVE_DIR_UP = ccui.ListViewMoveDirection.up
_G.LISTVIEW_MOVE_DIR_DOWN = ccui.ListViewMoveDirection.down
_G.LISTVIEW_MOVE_DIR_LEFT = ccui.ListViewMoveDirection.left
_G.LISTVIEW_MOVE_DIR_RIGHT = ccui.ListViewMoveDirection.right
LISTVIEW_MOVE_DIR_NONE = ccui.ListViewMoveDirection.none
LISTVIEW_MOVE_DIR_UP = ccui.ListViewMoveDirection.up
LISTVIEW_MOVE_DIR_DOWN = ccui.ListViewMoveDirection.down
LISTVIEW_MOVE_DIR_LEFT = ccui.ListViewMoveDirection.left
LISTVIEW_MOVE_DIR_RIGHT = ccui.ListViewMoveDirection.right
_G.LISTVIEW_EVENT_INIT_CHILD = ccui.ListViewEventType.init_child
_G.LISTVIEW_EVENT_UPDATE_CHILD = ccui.ListViewEventType.update_child
LISTVIEW_EVENT_INIT_CHILD = ccui.ListViewEventType.init_child
LISTVIEW_EVENT_UPDATE_CHILD = ccui.ListViewEventType.update_child
_G.LAYOUT_PARAMETER_NONE = ccui.LayoutParameterType.none
_G.LAYOUT_PARAMETER_LINEAR = ccui.LayoutParameterType.linear
_G.LAYOUT_PARAMETER_RELATIVE = ccui.LayoutParameterType.relative
LAYOUT_PARAMETER_NONE = ccui.LayoutParameterType.none
LAYOUT_PARAMETER_LINEAR = ccui.LayoutParameterType.linear
LAYOUT_PARAMETER_RELATIVE = ccui.LayoutParameterType.relative
ccui.LoadingBarType = ccui.LoadingBarDirection
ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT

View File

@ -1,3 +1,4 @@
ccui = ccui or {}
ccui.BrightStyle =