-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subclassing Starling Image and Sprite #121
Comments
You would probably want to start your quest here: LibraryLoader.creatorFactory It looks like you could easily override this property to return a custom implementation of the |
Fabulous. I implemented a custom |
Wish I'd noticed this thread when it was first posted. I've done some flump runtime display class customizing, and implementing CreatorFactory is how I did it as well. In case this is something that you were looking for as well, I wrote a mini tutorial on implementing pixel-level alpha hit detection in Starling/flump: http://codewright.roguenet.org/blog/2013/07/08/alpha-hit-testing/ |
Wow thanks roguenet, that's actually my next task. Was hoping Pixel Perfect Touch would do the trick, but very useful to see a Flump-specific approach. |
Yeah, you're going to see a tradeoff in performance, using a runtime tool like that pixel perfect touch extension. It's really slow to read through all the pixels in an image at runtime, but if you don't need to read that info for a lot of images, it might be good enough. My own blog post is also presented as a runtime tool, but I point out that it's a good idea to port the algorithm to a pre-process, which is what I ended up doing for my own game assets because in my case I'm working with many large sprite sheets. |
@chichilatte Hello, Thanks |
Hi, truly loving Flump, thanks to all contributors. I wonder if anyone's thought about how custom DisplayObject subclasses should work with Flump? For example, I might want
flump.display.LibraryImpl.createImage()
to create an instance ofmygame.display.ImageEx
which extendsstarling.display.Image
with extra useful functionality.As far as I can see it's not possible with casting or overriding. Hacking the Flump code works tho! Does (an unhacked) Flump preclude the use of custom DisplayObject subclasses?
The text was updated successfully, but these errors were encountered: