VSeed, an elegant data composer, transforming complexity into simplicity.
!!!###!!!title=Cross platform Interface——VisActor/VRender tutorial documents!!!###!!!!!!###!!!description=This chapter is not necessary for development, but if your application needs to run in different environments (nodejs, browser, mini programs) and you don't want to write compatibility code yourself, such as getting devicePixelRatio (dpr), creating Canvas, or using some utility functions, you can read this chapter.VRender provides a series of default interfaces to shield the impact of cross-platform, currently supporting `Browser`, `Node`, `feishu`, `tt`, and other environments can be supported through extensions.!!!###!!!
Cross-platform API Usage
This chapter is not necessary for development, but if your application needs to run in different environments (nodejs, browser, mini programs) and you don't want to write compatibility code yourself, such as getting devicePixelRatio (dpr), creating Canvas, or using some utility functions, you can read this chapter.
VRender provides a series of default interfaces to shield the impact of cross-platform, currently supporting Browser, Node, feishu, tt, and other environments can be supported through extensions.
Global
Global is a static class that provides global cross-platform APIs. Users can directly use Global as if it were the window of a browser, and Global will automatically provide cross-platform compatibility.
Global needs to manually set the environment, no need to add cross-platform methods by yourself
Note: When using the nodejs environment, Canopus will not automatically reference node-canvas, so users need to manually pass the node-canvas package