-
Notifications
You must be signed in to change notification settings - Fork 15
Core_API_Changes
Xrysnow edited this page Dec 18, 2020
·
1 revision
Most APIs is compatible with LuaSTGPlus. In following forms:
-
=>Lua
means the implementation is moved to Lua -
Dep
means it's deprecated (but still accessable) -
New
means it's added by LuaSTG-x -
N/A
means not accessable - empty means no change
-
SetFPS
SetVsync
can be used at runtime.
Function | Status |
---|---|
ChangeVideoMode | =>Lua |
DoFile | |
ExtractRes | =>Lua |
GetFPS | |
LoadPack | =>Lua |
SetFPS | |
SetResolution | =>Lua |
SetSplash | =>Lua |
SetTitle | =>Lua |
SetVsync | |
SetWindowed | =>Lua, Dep |
ShowSplashWindow | Dep |
SystemLog | |
UnloadPack | =>Lua |
-
PostEffectCapture
/PostEffectApply
are deprecated. They need to create temperaryRenderTarget
s due to implementation. The engine provides one temperaryRenderTarget
so that you can invoke them only once per frame. Please useCreateRenderTarget
/PushRenderTarget
/PopRenderTarget
instead. - New:
CreateShaderProgramFromPath
/CreateShaderProgramFromString
. They can compile GLSL shader and returncocos::backend::Program
object. When falied to compile, they will returnnil
and write information to log.
Function | Status |
---|---|
BeginScene | |
CreateGLProgramFromPath | New |
CreateGLProgramFromString | New |
EndScene | |
PopRenderTarget | =>Lua |
PostEffect | =>Lua |
PostEffectApply | =>Lua, Dep |
PostEffectCapture | =>Lua, Dep |
PushRenderTarget | =>Lua |
RenderClear | |
SetFog | |
SetOrtho | |
SetPerspective | |
SetViewport |
-
GetLastChar
is not accessable. - Key code is different (see
src/keycode.lua
). This will not affect usage. - Controller input system is different. It's done by the engine and will not affect usage.
- Controller keys are not mapped to key code but affect
GetKeyState
/GetLastKey
directly.
Function | Status |
---|---|
GetKeyState | |
GetLastChar | N/A |
GetLastKey | |
GetMousePosition | |
GetMouseState |
- New:
RegisterClass
. Used internally. -
CollisionCheck
now accepts game object. - New:
CollisionCheck3D
. -
Del
/Kill
now accept group number or game object array. - New:
BindNode
. Used to bindcocos::Node
object to game object.
- New:
RenderSector
. Used to draw HP bar of boss. - New:
DrawCollider
. Used internally, seesrc/core/corefunc.lua
.
Function | Status |
---|---|
DrawGroupCollider | New |
Render | =>Lua |
Render4V | =>Lua |
RenderRect | =>Lua |
RenderSector | New |
RenderTexture |
-
LoadFont
only supports HGE fonts now. HGE fonts will be converted to BMFont fromat and have some limitations. - Parameter of
LoadTTF
changes fromname, path, width, height
toname, path, size
. -
LoadFX
only accepts GLSL shaders now. It supports both fragment and vertex shaders (doc atdoc/lstg/resource.lua
). Default boss distortion effect is already provided. Note that coordinates of DX and OGL arg different. - New:
GetImageScale
. - Dep:
IsRenderTarget
. - All resource functions are moved to Lua.
- When play by stream, it will not be very accurate when set/get the playback position.
- All sound functions are moved to Lua.
- All text functions are moved to Lua.
- New:
CalcTextSize
. Used to calculate text size.
-
Execute
is deleted. Please useos.execute
.
-
json
/cjson
are now implemented by Lua. -
lfs
is not recommended to use. Functions fromplus
orcc.FileUtils
are easier to use. - Components of color object can be set/get directly by
a
/r
/g
/b
properties.