-
Notifications
You must be signed in to change notification settings - Fork 19
Core_API_Changes
Xrysnow edited this page Dec 18, 2020
·
1 revision
Most APIs is compatible with LuaSTGPlus. In following forms:
-
=>Luameans the implementation is moved to Lua -
Depmeans it's deprecated (but still accessable) -
Newmeans it's added by LuaSTG-x -
N/Ameans not accessable - empty means no change
-
SetFPSSetVsynccan 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/PostEffectApplyare deprecated. They need to create temperaryRenderTargets due to implementation. The engine provides one temperaryRenderTargetso that you can invoke them only once per frame. Please useCreateRenderTarget/PushRenderTarget/PopRenderTargetinstead. - New:
CreateShaderProgramFromPath/CreateShaderProgramFromString. They can compile GLSL shader and returncocos::backend::Programobject. When falied to compile, they will returnniland 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 |
-
GetLastCharis 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/GetLastKeydirectly.
| Function | Status |
|---|---|
| GetKeyState | |
| GetLastChar | N/A |
| GetLastKey | |
| GetMousePosition | |
| GetMouseState |
- New:
RegisterClass. Used internally. -
CollisionChecknow accepts game object. - New:
CollisionCheck3D. -
Del/Killnow accept group number or game object array. - New:
BindNode. Used to bindcocos::Nodeobject 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 |
-
LoadFontonly supports HGE fonts now. HGE fonts will be converted to BMFont fromat and have some limitations. - Parameter of
LoadTTFchanges fromname, path, width, heighttoname, path, size. -
LoadFXonly 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.
-
Executeis deleted. Please useos.execute.
-
json/cjsonare now implemented by Lua. -
lfsis not recommended to use. Functions fromplusorcc.FileUtilsare easier to use. - Components of color object can be set/get directly by
a/r/g/bproperties.