Saturday, October 6, 2012

Drawing API with Starling

Drawing APIThis week a very cool contribution was added to Starling by Robert Silverton, the Graphics API Extension! So what is it? From github: This extension adds Jon Pace's 'Fill' and 'Stroke' display objects, with support for adding arbitrary vertices that are then triangulated for rendering on the GPU. The aim is to reproduce Flash's graphics API as closely as possible via simplified lineTo, moveTo etc calls within Shape.graphics and Sprite.graphics. Once the basics have been reproduced, the API can be augmented with more powerful features. An ear-clipping algorithm is currently used for triangulating the simple polygons generated by the moveTo, lineTo methods. Supports both simple and non-simple (self-intersecting) polygons. For those of you who always felt that not having a drawing API was limiting, there you go. We are already thinking about some new APIs we could add to Flash Player and AIR to make this extension even more powerful. Graphics query, anyone? ;) Feel free to contribute and enhance it. Lee Thomason from our team has already sent some optimizations for curveTo. See you there! [...]

Read more: Drawing API with Starling

1 comment:

  1. code sample demo here :
    http://www.yopsolo.fr/wp/2012/10/05/starling-graphic-api-extension/

    ReplyDelete