Porting List to Addon SDK v2

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Easily integrate Telegram Mini Apps SDK into your Construct 3 projects for building interactive apps and games.
  • Have a great day!

    Maybe the current addon developers don't have free time to port the old addon.

    Maybe they have a lot of work to do.

    The only quick way to port quickly using automated tools.

    If someone on the forum has a problem with the SDK V1

    You can direct them here

    If what they are looking for is not there, they can ask for it in a Reply post with the addon SDK v1 link.

    Porting to Addon SDK v2 (Automatic)

    This porting process is very fast, taking only seconds.

    No monitoring, no testing.

    Once the porting is complete, the result will be automatically pushed to: https://github.com/EMIINDO?tab=repositories

    Not all Addon SDK V1s that are ported will be 100% successful or functional.

    Success depends on how the original developer created it.

    If it does not follow the standard documentation or The SDK API makes changes to the logic, it may fail.

    Example 1

    Combination of plugin and behavior instances in 1 addon, must make changes manually.

    ProUI

    Example 2

    As drawingPlugin or

    editorTextPlugin makes changes to the function logic, which must be handled manually, this porting will ignore the logic.

    This automatic porting will not affect any function logic.

    The porting logic only adjusts the necessary changes according to: porting-addon-sdk-v2

    It is not possible for me to download each addon one by one to distinguish between SDK V1 and SDK V2.

    So, if you have an issue, you need to provide the addon link for porting.

    The tool is still under testing.

    In about 1–2 weeks, the process of porting Behavior from SDK V1 to SDK V2 will begin.

    SDK V2 plugin list

    Check All: https://github.com/EMIINDO?tab=repositories

    Below that require no changes to the singleGlobalPlugin logic, and domMessagingPlugin and customImporterPlugin

    1. advancedlog
    2. csv-array-c3-runtime
    3. qr-code
    4. touch-plus
    5. greengrinds
    6. bubbly-background
    7. remote-image
    8. forge-c3-runtimeworkers
    9. copyclip
    10. simple-virtual-keyboard-c3
    11. drag-drop-files
    12. console-screenlog-js-c3
    13. rexpause-c3runtime
    14. photon-engine-c3
    15. moment-js-c3-runtime
    16. discord-rich-presence
    17. jszip-c3-runtime
    18. text-editor
    19. cordova-screenlock-c3-runtime
    20. vs-code-plugin
    21. sse
    22. numeral-js-c3-runtime
    23. securedata-c3runtime
    24. showdownjs
    25. app-review
    26. app-tracking-idfa-aaid
    27. app-version
    28. audio-url
    29. bilibili-danmaku-helper
    30. cjs
    31. Fontanus_I18Next
    32. EMI_INDO_ConsentReset
    33. mcAutoTiling
    34. EMI_INDO_CheckInternetAccess
    35. Sparsha_CloudflareTrace
    36. Colyseus_SDK
    37. MohammadHadi_CordovaToast
    38. StraniAnelli_InjectCSS_v2
    39. EMI_INDO_Diagnostic
    40. intch_discordwebhook
    41. ValerypopoffEase
    42. Flikes_EasyVariable
    43. Sparsha_ErudaConsole
    44. MassiveCube_FacebookInstantExtended
    45. MassiveCube_DrawBackground
    46. EMI_INDO_AnalyticsBasic
    47. EMI_INDO_WebAuthentication
    48. EMI_INDO_WebAuthentication
    49. EMI_INDO_CloudFirestore
    50. EMI_INDO_WebCloudStorage
    51. EMI_INDO_Firebase_In_App_Messaging
    52. EMI_INDO_RemoteConfigBasic
    53. EMI_INDO_Crashlytics
    54. GameAnalytics
    55. GM_SDK
    56. Mikal_GameSparksMinimal
    57. AtheiosTeam_AtheiosModule
    58. c3IDE_GHTA_iziToast
    59. Mikal_GIFPlayer
    60. Mikal_GithubLink
    61. Globals
    62. PaulPlay_HideHomebutton
    63. EMI_INDO_plugin_android_imei
    64. EMI_INDO_in_app_update
    65. EMI_INDO_inappbrowser
    66. SmugRainbowPony_INK

    Process porting SDK V1 to SDK v2

    Subscribe to Construct videos now

    Creating a c3addon file

    Subscribe to Construct videos now

    This is not duplicate documentation, but from some of the porting test results there are errors in the browser, finding error lines from the v1 SDK, which may be able to be fixed manually as below.

    GetAssetManager

    sdk v1 error 
    await this.GetRuntime().GetAssetManager().LoadProjectFileUrl(nameFile);
    sdk v2 fix
    await this.runtime.assets.getProjectFileUrl(nameFile);
    

    Changes in Naming Conventions

    // SDK v1
    let myinstance = this._inst.GetWorldInfo();
    myinstance.SetXY(x, y);
    
    // SDK v2 
    // Access the position property directly or use the methods provided
    this.x = x;
    this.y = y;
    this.setBboxChanged();
    

    Access Object Information

    // SDK v1
    const imageInfo = this._objectClass.GetImageInfo();
    const texture = imageInfo.GetTexture();
    
    // SDK v2
    const imageInfo = this.objectType.getImageInfo();
    const texture = imageInfo.getTexture(renderer);
    

    API Renderer

    // SDK v1
    renderer.SetTexture(texture);
    renderer.Quad3(quad, rcTex);
    
    // SDK v2
    renderer.setTexture(texture);
    renderer.quad3(quad, rcTex);
    

    Pixel Rounding Settings

    // SDK v1
    if (this._runtime.IsPixelRoundingEnabled())
    {
     // offset calculation
    }
    
    // SDK v2
    if (this.runtime.isPixelRoundingEnabled)
    {
     // offset calculation
    }
    

    Quad Bounding Processing Adjustment

    // SDK v1 
    const wi = this.GetWorldInfo();
    const quad = wi.GetBoundingQuad();
    // ... offset calculation
    tempQuad.copy(quad);
    tempQuad.offset(ox, oy);
    renderer.Quad3(tempQuad, rcTex);
    
    
    
    // SDK v2
    let quad = this.getBoundingQuad();
    // ... offset calculation
    if (ox !== 0 && oy !== 0)
    {
     quad = new DOMQuad(
     new DOMPoint(quad.p1.x + ox, quad.p1.y + oy),
     new DOMPoint(quad.p2.x + ox, quad.p2.y + oy),
     new DOMPoint(quad.p3.x + ox, quad.p3.y + oy),
     new DOMPoint(quad.p4.x + ox, quad.p4.y + oy)
     );
    }
    renderer.quad3(quad, rcTex);
    
  • Have a great day!

    Check All: https://github.com/EMIINDO?tab=repositories

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Manual Porting Plugin

    1. editorTextPlugin
    2. drawingPlugin

    Update editorTextPlugin to addon SDK v2

    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/addon.json'
    ❌ SDK v1: "sdk-version": 1, ➝ βœ… SDK v2: "sdk-version": 2,
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/c3runtime/actions.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/c3runtime/conditions.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/c3runtime/expressions.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/c3runtime/instance.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: C3.Plugins.MyCompany_TextPlugin.Instance = class MyTextInstance extends C3.SDKWorldInstanceBase ➝ βœ… SDK v2: C3.Plugins.MyCompany_TextPlugin.Instance = class MyTextInstance extends globalThis.ISDKWorldInstanceBase
    ❌ SDK v1: constructor(inst, properties) ➝ βœ… SDK v2: constructor()
    ❌ SDK v1: super(inst); ➝ βœ… SDK v2: super();
    βœ… New SDK v2: const properties = this._getInitProperties();
    ❌ SDK v1: Release() ➝ βœ… SDK v2: _release()
    ❌ SDK v1: super.Release(); ➝ βœ… SDK v2: super._release();
    ❌ SDK v1: _MaybeCreateRendererText(renderer) ➝ βœ… SDK v2: _maybeCreateRendererText(renderer)
    ❌ SDK v1: this._rendererText.SetIsAsync(false); ➝ βœ… SDK v2: this._rendererText = renderer.createRendererText();
    βœ… New SDK v2: this._rendererText.sizePt = 12;
    ❌ SDK v1: Draw(renderer) ➝ βœ… SDK v2: _draw(renderer)
    βœ… New SDK v2: this._maybeCreateRendererText(renderer);
    βœ… New SDK v2: 
    βœ… New SDK v2: const layer = this.layer;
    βœ… New SDK v2: const textZoom = layer.renderScale;
    βœ… New SDK v2: this._rendererText.setSize(this.width, this.height, textZoom);
    βœ… New SDK v2: 
    βœ… New SDK v2: this._rendererText.fontFace = this._font;
    βœ… New SDK v2: this._rendererText.text = this._text;
    βœ… New SDK v2: 
    βœ… New SDK v2: let quad = this.getBoundingQuad();
    βœ… New SDK v2: const texture = this._rendererText.getTexture();
    βœ… New SDK v2: 
    βœ… New SDK v2: 
    ❌ SDK v1: if (wi.GetAngle() === 0 && wi.GetLayer().GetAngle() === 0) ➝ βœ… SDK v2: if (this.angle === 0 && layer.angle === 0)
    ❌ SDK v1: tempQuad.setFromRect(tempRect); ➝ βœ… SDK v2: const [dl, dt] = layer.layerToDrawSurface(quad.p1.x, quad.p1.y);
    βœ… New SDK v2: const [dr, db] = layer.layerToDrawSurface(quad.p3.x, quad.p3.y);
    βœ… New SDK v2: const ox = Math.round(dl) - dl;
    βœ… New SDK v2: const oy = Math.round(dt) - dt;
    βœ… New SDK v2: quad = new DOMQuad(new DOMPoint(dl + ox, dt + oy),
    βœ… New SDK v2: new DOMPoint(dr + ox, dt + oy),
    βœ… New SDK v2: new DOMPoint(dr + ox, db + oy),
    βœ… New SDK v2: new DOMPoint(dl + ox, db + oy));
    ❌ SDK v1: this._runtime.GetCanvasManager().SetDeviceTransform(renderer); ➝ βœ… SDK v2: renderer.setDeviceTransform();
    ❌ SDK v1: renderer.Quad3(tempQuad, this._rendererText.GetTexRect()); ➝ βœ… SDK v2: renderer.setTexture(texture);
    βœ… New SDK v2: renderer.quad3(quad, this._rendererText.getTexRect());
    ❌ SDK v1: layer._SetTransform(renderer); ➝ βœ… SDK v2: renderer.setLayerTransform(layer);
    ❌ SDK v1: let offY = 0; ➝ βœ… SDK v2: let ox = 0;
    βœ… New SDK v2: let oy = 0;
    ❌ SDK v1: if (this._runtime.IsPixelRoundingEnabled()) ➝ βœ… SDK v2: if (this.runtime.isPixelRoundingEnabled)
    ❌ SDK v1: quad = tempQuad; ➝ βœ… SDK v2: ox = Math.round(quad.p1.x) - quad.p1.x;
    βœ… New SDK v2: oy = Math.round(quad.p1.y) - quad.p1.y;
    βœ… New SDK v2: 
    βœ… New SDK v2: if (ox !== 0 || oy !== 0)
    βœ… New SDK v2: {
    βœ… New SDK v2: quad = new DOMQuad(new DOMPoint(quad.p1.x + ox, quad.p1.y + oy),
    βœ… New SDK v2: new DOMPoint(quad.p2.x + ox, quad.p2.y + oy),
    βœ… New SDK v2: new DOMPoint(quad.p3.x + ox, quad.p3.y + oy),
    βœ… New SDK v2: new DOMPoint(quad.p4.x + ox, quad.p4.y + oy));
    βœ… New SDK v2: }
    ❌ SDK v1: renderer.Quad3(quad, this._rendererText.GetTexRect()); ➝ βœ… SDK v2: renderer.setTexture(texture);
    βœ… New SDK v2: renderer.quad3(quad, this._rendererText.getTexRect());
    ❌ SDK v1: SaveToJson() ➝ βœ… SDK v2: _saveToJson()
    ❌ SDK v1: LoadFromJson(o) ➝ βœ… SDK v2: _loadFromJson(o)
    ❌ SDK v1: _SetText(text) ➝ βœ… SDK v2: _setText(text)
    ❌ SDK v1: _GetText() ➝ βœ… SDK v2: _getText()
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/c3runtime/plugin.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: C3.Plugins.MyCompany_TextPlugin = class MyTextPlugin extends C3.SDKPluginBase ➝ βœ… SDK v2: C3.Plugins.MyCompany_TextPlugin = class MyTextPlugin extends globalThis.ISDKPluginBase
    ❌ SDK v1: constructor(opts) ➝ βœ… SDK v2: constructor()
    ❌ SDK v1: super.Release(); ➝ βœ… SDK v2: super();
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/c3runtime/type.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: C3.Plugins.MyCompany_TextPlugin.Type = class MyTextType extends C3.SDKTypeBase ➝ βœ… SDK v2: C3.Plugins.MyCompany_TextPlugin.Type = class MyTextType extends globalThis.ISDKObjectTypeBase
    ❌ SDK v1: constructor(objectClass) ➝ βœ… SDK v2: constructor()
    ❌ SDK v1: super(objectClass); ➝ βœ… SDK v2: super();
    ❌ SDK v1: OnCreate() ➝ βœ… SDK v2: _onCreate()
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/instance.js'
    ❌ SDK v1: const SDK = self.SDK; ➝ βœ… SDK v2: const SDK = globalThis.SDK;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/plugin.js'
    ❌ SDK v1: const SDK = self.SDK; ➝ βœ… SDK v2: const SDK = globalThis.SDK;
    ❌ SDK v1: this._info.SetVersion(PLUGIN_VERSION); ➝ βœ… SDK v2: this._info.SetName(globalThis.lang(".name"));
    βœ… New SDK v2: this._info.SetDescription(globalThis.lang(".description"));
    ❌ SDK v1: this._info.SetHelpUrl(self.lang(".help-url")); ➝ βœ… SDK v2: this._info.SetHelpUrl(globalThis.lang(".help-url"));
    
    πŸ“ filePath: 'a/plugin-sdk/v2/editorTextPlugin/type.js'
    ❌ SDK v1: const SDK = self.SDK; ➝ βœ… SDK v2: const SDK = globalThis.SDK;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/addon.json'
    ❌ SDK v1: "sdk-version": 1, ➝ βœ… SDK v2: "sdk-version": 2,
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/c3runtime/actions.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: alert("Test property = " + this._GetTestProperty()); ➝ βœ… SDK v2: alert("Test property = " + this._getTestProperty());
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/c3runtime/conditions.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/c3runtime/expressions.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/c3runtime/instance.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: C3.Plugins.MyCompany_DrawingPlugin.Instance = class DrawingInstance extends C3.SDKWorldInstanceBase ➝ βœ… SDK v2: C3.Plugins.MyCompany_DrawingPlugin.Instance = class DrawingInstance extends globalThis.ISDKWorldInstanceBase
    ❌ SDK v1: constructor(inst, properties) ➝ βœ… SDK v2: constructor()
    ❌ SDK v1: super(inst); ➝ βœ… SDK v2: super();
    βœ… New SDK v2: const properties = this._getInitProperties();
    ❌ SDK v1: Release() ➝ βœ… SDK v2: _release()
    ❌ SDK v1: super.Release(); ➝ βœ… SDK v2: super._release();
    ❌ SDK v1: Draw(renderer) ➝ βœ… SDK v2: _draw(renderer)
    ❌ SDK v1: const texture = imageInfo.GetTexture(); ➝ βœ… SDK v2: const imageInfo = this.objectType.getImageInfo();
    βœ… New SDK v2: const texture = imageInfo.getTexture(renderer);
    ❌ SDK v1: renderer.SetTexture(texture); ➝ βœ… SDK v2: let quad = this.getBoundingQuad();
    βœ… New SDK v2: const rcTex = imageInfo.getTexRect();
    ❌ SDK v1: else ➝ βœ… SDK v2: renderer.setTexture(texture);
    βœ… New SDK v2: 
    βœ… New SDK v2: if (this.runtime.isPixelRoundingEnabled)
    ❌ SDK v1: renderer.Quad3(quad, rcTex); ➝ βœ… SDK v2: const ox = Math.round(this.x) - this.x;
    βœ… New SDK v2: const oy = Math.round(this.y) - this.y;
    βœ… New SDK v2: 
    βœ… New SDK v2: if (ox !== 0 && oy !== 0)
    βœ… New SDK v2: {
    βœ… New SDK v2: quad = new DOMQuad(new DOMPoint(quad.p1.x + ox, quad.p1.y + oy),
    βœ… New SDK v2: new DOMPoint(quad.p2.x + ox, quad.p2.y + oy),
    βœ… New SDK v2: new DOMPoint(quad.p3.x + ox, quad.p3.y + oy),
    βœ… New SDK v2: new DOMPoint(quad.p4.x + ox, quad.p4.y + oy));
    βœ… New SDK v2: }
    βœ… New SDK v2: 
    βœ… New SDK v2: renderer.quad3(quad, rcTex);
    ❌ SDK v1: SaveToJson() ➝ βœ… SDK v2: _saveToJson()
    ❌ SDK v1: LoadFromJson(o) ➝ βœ… SDK v2: _loadFromJson(o)
    ❌ SDK v1: _SetTestProperty(n) ➝ βœ… SDK v2: _setTestProperty(n)
    ❌ SDK v1: _GetTestProperty() ➝ βœ… SDK v2: _getTestProperty()
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/c3runtime/plugin.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: C3.Plugins.MyCompany_DrawingPlugin = class DrawingPlugin extends C3.SDKPluginBase ➝ βœ… SDK v2: C3.Plugins.MyCompany_DrawingPlugin = class DrawingPlugin extends globalThis.ISDKPluginBase
    ❌ SDK v1: constructor(opts) ➝ βœ… SDK v2: constructor()
    ❌ SDK v1: super.Release(); ➝ βœ… SDK v2: super();
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/c3runtime/type.js'
    ❌ SDK v1: const C3 = self.C3; ➝ βœ… SDK v2: const C3 = globalThis.C3;
    ❌ SDK v1: C3.Plugins.MyCompany_DrawingPlugin.Type = class DrawingType extends C3.SDKTypeBase ➝ βœ… SDK v2: C3.Plugins.MyCompany_DrawingPlugin.Type = class DrawingType extends globalThis.ISDKObjectTypeBase
    ❌ SDK v1: constructor(objectClass) ➝ βœ… SDK v2: constructor()
    ❌ SDK v1: super(objectClass); ➝ βœ… SDK v2: super();
    ❌ SDK v1: Release() ➝ βœ… SDK v2: _onCreate()
    ❌ SDK v1: this.GetImageInfo().LoadAsset(this._runtime); ➝ βœ… SDK v2: this.runtime.assets.loadImageAsset(this.getImageInfo());
    ❌ SDK v1: LoadTextures(renderer) ➝ βœ… SDK v2: _loadTextures(renderer)
    ❌ SDK v1: sampling: this._runtime.GetSampling() ➝ βœ… SDK v2: return renderer.loadTextureForImageInfo(this.getImageInfo(), {
    βœ… New SDK v2: sampling: this.runtime.sampling
    ❌ SDK v1: ReleaseTextures() ➝ βœ… SDK v2: _releaseTextures(renderer)
    ❌ SDK v1: this.GetImageInfo().ReleaseTexture(); ➝ βœ… SDK v2: renderer.releaseTextureForImageInfo(this.getImageInfo());
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/instance.js'
    ❌ SDK v1: const SDK = self.SDK; ➝ βœ… SDK v2: const SDK = globalThis.SDK;
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/plugin.js'
    ❌ SDK v1: const SDK = self.SDK; ➝ βœ… SDK v2: const SDK = globalThis.SDK;
    ❌ SDK v1: this._info.SetVersion(PLUGIN_VERSION); ➝ βœ… SDK v2: this._info.SetName(globalThis.lang(".name"));
    βœ… New SDK v2: this._info.SetDescription(globalThis.lang(".description"));
    ❌ SDK v1: this._info.SetHelpUrl(self.lang(".help-url")); ➝ βœ… SDK v2: this._info.SetHelpUrl(globalThis.lang(".help-url"));
    
    πŸ“ filePath: 'a/plugin-sdk/v2/drawingPlugin/type.js'
    ❌ SDK v1: const SDK = self.SDK; ➝ βœ… SDK v2: const SDK = globalThis.SDK;
    
    
    
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)