Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

Add graphics API for drawing #1010

Open alevys opened 6 years ago

alevys commented 6 years ago

Really need the ability to draw lines as in classic flash. Need native capability of the library. External libraries like starling-extension-graphics is already abandoned and will not be updated to match the current development of the Starling.

PrimaryFeather commented 6 years ago

It's definitely not a straightforward feature to add, but I know it would be super useful, and it's been on the back of my mind for a long time. Thanks for adding the issue!

I changed the title a little since I'd be adding lines as part of a more general drawing API, and I wouldn't force myself to stick 100% with the Flash API.

alevys commented 6 years ago

Do not have to repeat the flash API, the main thing that it were possible to draw. Very, very'll wait for this feature. :)

22Round commented 6 years ago

+1

hardcoremore commented 6 years ago

+1

matrix3d commented 6 years ago

http://blog.bwhiting.co.uk/?p=423

soimy commented 6 years ago

@alevys Actually, there is a usable starling-extension-graphics for starling v2 which will be working after some minor tweaks. ( And here is my fork)

I believe there are more effective ways to do vector triangulation, and no Ex-version ( editable vector ). But at least it's working.

Below is what I've done with the help of this extension: Gear&Chain Simulator

Dima107 commented 4 years ago

@alevys Actually, there is a usable starling-extension-graphics for starling v2 which will be working after some minor tweaks. ( And here is my fork)

I believe there are more effective ways to do vector triangulation, and no Ex-version ( editable vector ). But at least it's working.

Below is what I've done with the help of this extension: Gear&Chain Simulator

I need starling grpahics extention too. But It looks like "beginTextureFill" and "lineTexture" doesn't works in oringal and your fork of graphic. Can you help me with it?

hardcoremore commented 4 years ago

Yes texture fill does not work as well. I would like to have that but don't know how to implement it. I also have my own port here https://bitbucket.org/hardcoremore/starlinggraphicsextension/src/master/

Fancy2209 commented 1 month ago

@alevys Actually, there is a usable starling-extension-graphics for starling v2 which will be working after some minor tweaks. ( And here is my fork)

I believe there are more effective ways to do vector triangulation, and no Ex-version ( editable vector ). But at least it's working.

Below is what I've done with the help of this extension: Gear&Chain Simulator

Is the code you used to triangulate the vectors available anywhere? I've been looking into trying to allow HW Vectors in flash/starling and I'd love to see how other people have done it for ideas

hardcoremore commented 1 month ago

Just want to add in my fork: https://bitbucket.org/hardcoremore/starlinggraphicsextension/src/master/

Texture fill is working. Also you can draw lines with texture. I have also implemented miter, bevel and round joint types. I have fixed many bugs and added features. But still there are some things to be fixed.

PrimaryFeather commented 1 month ago

Great to see an update on this, @hardcoremore! 😄 Thanks for sharing!

hardcoremore commented 1 month ago

Well I am trying to fix one more bug which is when line is too thick and angle between two segments is too sharp. Hope I can fix it. I need it for my game as well. 😄