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

Starling 2 #145

Open teotigraphix opened 8 years ago

teotigraphix commented 8 years ago

Just curious as when Starling 2 rolls out and Feathers, will this be compatible then?

IonSwitz commented 8 years ago

I have started to look into rudimentary support for Starling 2.0, but it is not likely to be fully supported, no, unless I get help to implement it. To make it really good, I would have to spend time that I currently do not have.

I will do my best, however.

teotigraphix commented 8 years ago

Totally understand. It was more that I have some apps I am releasing that use feathers 100% and was looking into using the drawing api. But when feathers updates, he is requiring 2.0 so I guess I will have to wait.

If I knew more about the low level of starling I would gladly help get it going but I don't think I know enough to be of help right now.

ghost commented 8 years ago

+1

22Round commented 8 years ago

+1

zenrobin commented 8 years ago

We fell in love with this extension when we first found it. Used RoundedRectangles all over the place, and still use it to draw some interesting shapes dynamically.

But beyond that, we didn't touch the rest of the functionality. Perhaps a survey of what people use most is in order. That way, we can identify the best features of this extension that are wholesale missing from Starling.

Also, for what it's worth, we ended up having major lost context issues with RoundedRectangle. Couldn't find a reliable way around it (especially on android). So we went with a set of scale 9 oval textures instead. They don't take much texture space and can be scaled to whatever size necessary with minimal quality sacrifice. We have oval outlines too to replace the need for strokes. The textures are all white -- we use starling color tinting to customize as needed.

Would love to know how others are using the extension and whether there are other Starling workarounds (because IonSwitz is very busy!!)

teotigraphix commented 8 years ago

I ended up using the native Flash Graphics API and with Feathers I have invalidation. So in some of my really complex sequencers, I needed dynamic but "static" backgrounds of grids and such. So I just end up drawing all my new assets during a change for the component and create an atlas using Bitmap data draw(), then load those textures into Feather's Scale9 or Image components.

This seems to work really well performance wise, I am only drawing on invalidation. I just needed something to work when I switch to Feathers 3 and Starling 2.

IonSwitz commented 8 years ago

I am hoping that the problem with lost context issues now have been fixed. The Program cache wasn't being cleared out properly. If you have code that didn't work before stored away somewhere, please get the latest sources and try again.

meduhealth commented 8 years ago

+1 👍

Is there any change it will be compatible with the release V2 of Starling ?

Thanks a LOT! ! & Keep up the good work.

OneHalf3544c commented 8 years ago

+1

IonSwitz commented 8 years ago

Thanks for the support and desire to get this updated to 2.0, but I simply do not have the time. I don't know of anyone else of the maintainers of this extension who have the time either. This is very unfortunate, and I am really sorry about this.

joefaron commented 8 years ago

That's not good for me.. :-1:

joefaron commented 8 years ago

For what it's worth.. was using it to also do rounded rectangles.. bye bye Shape()'s.

matej-snivam commented 8 years ago

+1

varadig commented 7 years ago

+1

piratejet commented 7 years ago

+1

leefj commented 7 years ago

+1

pSi-X commented 7 years ago

+1

leefj commented 7 years ago

+1

aviatek commented 7 years ago

+1

IonSwitz commented 7 years ago

Unfortunately, nothing has changed since my post on May 5th.

22Round commented 7 years ago

@IonSwitz we never giving up +1

pautus commented 7 years ago

hey guys,

Here is a working version of Starling 2 graphics extension. https://www.dropbox.com/s/o8vcjnv1zzgrff5/starling_display_ext.zip?dl=0

I'm not sure about pref since there is a dirty enterframe in Shape to keep the display alive...without it, for some reasons the shape appear for just a sec... Also i'm not sure everything is working fine...let me know if you have trouble. @IonSwitz maybe you have an idea on the enterFrame issue ?

Hope it helps. Seb

IonSwitz commented 7 years ago

That's great! Did you write this? :)

The enterFrame detail seems to be triggering a "setRequiresRedraw" which should not be solved by changing the x position like that :) I will see what I can do to investigate this.

Edit: From reading the code in DisplayObject of Starling 2.0, this seems to matter:

If the object needs to be redrawn just because it does not support the render cache, call painter.excludeFromCache() in the object's render method instead. That way, Starling's skipUnchangedFrames policy won't be disrupted.

So, the "painter.excludeFromCache()" method should be called in the Graphic objects render method, apparently.

Add "renderSupport.excludeFromCache()" after "if ( indices == null || indices.length < 3 ) return; " in the Graphic render() method, line 363.

@pautus

Ideally, the classes should support the render cache, but this seems to be a good solution so far.

IonSwitz commented 7 years ago

@pautus I got this to work just fine now, adding the "renderSupport.excludeFromCache(this) as mentioned above, and removing the onEnterFrame event in Shape.

If it is ok with you, I'd like to add this to GitHub as part of the StarlingGraphics Organization. Basically it would appear as a second repository next to Starling-Extension-Graphics. The reason for this is that the code paths have diverged a bit, it seems your excellent fix for 2.0 isn't built upon the "latest" of the Starling-Extension-Graphics code path, which makes diffing a bit tricky, (at least for me, as I am NOT a comfortable Git user )

pautus commented 7 years ago

Hey @IonSwitz thanks for your kind answer ! Yeahhhh ! just tested the excludeFromCache() working just fine here too ! That's great news, I guess a lot of people will be happy, including me :) Was not proud of that EnterFrame awful thing, but I was kind of in a rush :p To be very honest with you i was very close to fix it by myself but i had just a last thing with the blendMode that get me in trouble and then i found the solution in a russian forum ^^ As you can see lots of people around the world need this extension ;) I'm totally ok with a release, go ahead and do what's the best for you ! :)

IonSwitz commented 7 years ago

I have currently added this code to "extension2.0" in this repository. I'm a terrible GitHub user, but I wanted to get the code up and made public, so I just slammed the code into the repository.

Thanks for your work. I will see if I can find the time to add some of the more up to date stuff I added to the extension to the 2.0 branch, but this helps a LOT. Excellent work!

IonSwitz commented 7 years ago

@pautus Also, there is a class called "Button.as" in the repository now, that seems like something that shouldnt be in this extension, or am I missing something?

pautus commented 7 years ago

My very pleasure :) Oups, yes the Button class is for one of my project...i just forget to removed it, my bad sorry.

teotigraphix commented 7 years ago

@pautus Curious, I coned the repo and used extension2.0-scr in a Library project. 2 things won't compile, Graphics_bak and TriangleUtils doesn't have the correct package.

I take it you are not using this as a swc, so you don't get these errors?

teotigraphix commented 7 years ago

One other thing, in TriangleUtils, import starling.core.RenderSupport could not be found.

I got this all to compile obviously but, might make it easier for others if the code did compile in a library project. :) Thanks for this will be trying it out today.

pautus commented 7 years ago

@teotigraphix this is class and import i forgot to clean. sorry about that.

teotigraphix commented 7 years ago

No problem, I didn't mean anything other than constructive. You have done a great thing with this code, thanks so much. Down the road I might get into it more to see if I can help, now that it's "into" Starling 2 code base.

pautus commented 7 years ago

@teotigraphix ;) this is a great plugin, good to have it back ! Hope we'll find great new features all togheter !

22Round commented 7 years ago

@IonSwitz would be nice if you create new repository for starling2

IonSwitz commented 7 years ago

@22Round Yeah, it would be nice. I agree that the current situation isn't awesome.

Unfortunately, I am not a "owner" of the StarlingGraphics Organization here on GitHub, only a contributor, so I can't start a new Repository on the StarlingGraphics Organization page here: https://github.com/StarlingGraphics

Maybe @robsilv or @jonathanrpace could bump me up to "owner" status, and I'd try to set it up.

I could also start a second Organization to host it, but that seems just silly. :)

IonSwitz commented 7 years ago

@pautus Have you tried doing any work with textures, and gotten it to work?

Currently, I can't see them working when doing a textureFill...

robsilv commented 7 years ago

@IonSwitz have upgraded you to an owner! :-)

pautus commented 7 years ago

@IonSwitz not i did not...it's also a matter of time here, end of the year will be very busy :/ I will check it as soon as possible.

yooni126 commented 7 years ago

can we use GradientTexture in starling 2?

IonSwitz commented 7 years ago

No textures are working, as far as I can see. So, no, not yet.

yooni126 commented 7 years ago

How long we must stay to access all of features of this extenstion for starling 2?

IonSwitz commented 7 years ago

I have no time to develop the Starling Graphics Extension further. If @pautus keeps working on it, that would be great, but as of now, I don't see that there will be any progress made here.

Maybe Daniel will start working on it to integrate it into the main Starling framework, I know he has expressed a desire for it, but it seems unlikely.

yooni126 commented 7 years ago

ok thank u :(

pautus commented 7 years ago

@IonSwitz @yooni126 I'm so sorry, i can't work on that part for now... :/ too much to manage. I'll try to take a look soon, but do you have a sample of code with textures please ?

yooni126 commented 7 years ago

@pautus where are you? can u help us to upgrade this extension with all properties like gradiant to starling 2?

pautus commented 6 years ago

@yooni126 sorry guys have so much things to manage (personal and work)...do you have any code sample that is not working so i can make a quick check ?