StarlingGraphics / Starling-Extension-Graphics

flash.display.Graphics style extension for the Starling Flash GPU rendering framework
https://github.com/StarlingGraphics/Starling-Extension-Graphics/wiki
MIT License
282 stars 89 forks source link

Painting App #115

Open abdulraafay6 opened 10 years ago

abdulraafay6 commented 10 years ago

Hi,

I'm developing drawing app using your library and i need advice:

1- currently i'm using 1 shape, and colors it on touch input, but eventually drawing slows down !

2- how do i simulate a brush stroke, for example, if i apply a texture to linestyle and draw it using lineTo, texture looks good if i move touch fastly, otherwise it looks repeatdly if i slowly move !

3- In short, please advise me on all those things that i can encounter, and also what can i done with existing feature of the library (as there is no documentation yet).

Thanks

IonSwitz commented 10 years ago

Hello, and thank you for using the SEG.

I will try to answer some of your questions:

1) If possible, try to break up the Shape after a number of touches. Every time new vertices are added to a Shape, it gets redrawn on render, so if you add just a few new vertices to a Shape that already has 2000 vertices, things will get very slow. Try to break them up into multiple Shapes when the number of vertices in each Shape gets "large", (maybe 100 or so? Hard to tell what is optimal, really)

2) Here, it sounds like some sample code could be useful. Could you create a small test sample of what you are trying to do, and maybe I or someone else can have a look at it. It is very hard to talk in the abstract about these kinds of things, unfortunately.

3) I cant advise you on all things that you can encounter, and everything that can be done with the existing features of the library. The feature set is fairly set and limited, but if you look through the Examples, I am sure you can find some good starting points for various feature sets.