chenenyu

Hi, i'm writing an runtime for Flutter, and i referenced spine-webgl in spine-ts, but i noticed that the implementation of spine-webgl used shader and WebGLRenderingContext, which are not exists in Flutter. How can i evade these limitations to get a simple implementation?
chenenyu
  • Mesajlar: 1

Mario

You can use Flutter's Canvas API instead. The general structure of your code will follow SkeletonRenderer from spine-webgl. You can use:

1. https://api.flutter.dev/flutter/dart-ui/Canvas/clipPath.html for clipping attachments
2. https://api.flutter.dev/flutter/dart-ui/Canvas/drawVertices.html for rendering RegionAttachment and MeshAttachment including blend mode support.

You'll also need a way to load images for texture atlas pages. I'm unfamiliar with how that works in Flutter, it should be simple to load images that can be drawn via Canvas though.
Kullanıcı avatarı
Mario

Mario
  • Mesajlar: 2965

sign

chenenyu yazdı:Hi, i'm writing an runtime for Flutter, and i referenced spine-webgl in spine-ts, but i noticed that the implementation of spine-webgl used shader and WebGLRenderingContext, which are not exists in Flutter. How can i evade these limitations to get a simple implementation?
The forum http://esotericsoftware.com/forum/Will-Spine-Runtime-support-for-Flutter-16672?p=74832 is discussing a topic whose posts might make you happy :)
sign
  • Mesajlar: 8


Dön 中国Spine用户