Starling Forum

The Starling Framework Community

Register or log in - lost password?

Starling Forum » Libraries for Starling » Feathers

OLD Official Foxhole Components Q&A

(286 posts) (47 voices)
  • Started 1 year ago by Josh Tynjala
  • Latest reply from jedi

Tags:

  • 9-slice
  • actionscript
  • bmfont
  • bug
  • button
  • callout
  • component
  • components
  • container
  • examples
  • foxhole dragdrop
  • help
  • label component foxhole
  • layout
  • mask
  • mobile
  • new components
  • open source
  • responsive
  • scale 9
  • Screen Navigator
  • ScreenNavigator
  • ScrollBar
  • ScrollContainer
  • TextInput
  • ui
  • user interface
« Previous123…10Next »
  1. killerspaz

    Competent Bird
    Joined: Mar '12
    Posts: 32

    I create a quick LayoutHelper to assist in laying out lots of controls: http://blog.killerspaz.com/2012/04/02/starling-foxholecontrols-layouthelper/

    Keep in mind, it's simple, but supports the following:
    * Global container padding
    * Gapsize
    * Horizontal and Vertical "Layout"
    * Flow - whether to create a new row/column or just infinitely lay out a single direction (default = true)

    Usage is simple...
    * In a FoxholeControl::initialize(), create a new instance and pass self into it:

            override protected function initialize():void
            {
                super.initialize();
     
                this._layoutHelper                  = new LayoutHelper(this);
                this._layoutHelper.direction        = LayoutHelper.DIRECTION_VERITCAL;
                //this._layoutHelper.allowFlow        = false;
      ...

    * In FoxholeControl::draw(), simply put:

            override protected function draw():void
            {
                super.draw();
     
                this._layoutHelper.layout();
            }

    I hope this helps someone, it's shortened my logic up quite a bit since I no longer have to do math based on each and every component, and can just create quick containers!

    Posted 1 year ago #
  2. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    :: makes me think of C++. It's been years since I wrote anything in that language.

    Thanks for sharing. I hope to add proper layout containers eventually.

    Posted 1 year ago #
  3. killerspaz

    Competent Bird
    Joined: Mar '12
    Posts: 32

    Heh, yeah.

    It's been adopted over the years into other languages, and even UML for identifying scope resolution.

    A lot about starling has reminded me of my older c++/dx9 days It's been quite a while since I've worked with bitmaps and sprite sheets! Missing my vector assets like crazy, and I've been heavily spoiled by flex's components and their architecture.

    Posted 1 year ago #
  4. fabiobiondi

    Senior Bird
    Joined: Mar '12
    Posts: 66

    Hi Josh,
    I have download and tested the new version of FoxHole components.
    Sorry but I forgot to add stats

    Anyway:

    Ipad3: all components are very fast (maybe too much, like the List : ) and I see transitions. Great !

    Ipad1: I think I have around 15 fps in the List and I see only a part of the transitions but it's not bad since Ipad1 is really slow

    I only have a little issue that I didn't have before this update: a lot of fonts are not readable on IPad3 and on my desktop (on Ipad1 they works well).
    I can mail you a screenshot, if you need it

    Posted 1 year ago #
  5. killerspaz

    Competent Bird
    Joined: Mar '12
    Posts: 32

    Yeah if you look a few posts back, I make mention of it, and supplied a screenshot... Josh believes it's related to pixel snapping, which is now disabled.

    I haven't made the change locally to test, but it sounds reasonable, as it's probably trying to center and getting odd pixels.

    Posted 1 year ago #
  6. fabiobiondi

    Senior Bird
    Joined: Mar '12
    Posts: 66

    ups... you're right.
    Sorry killerspaz : )

    Posted 1 year ago #
  7. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    I get 20-22 fps when scrolling the List with iPad 1, but it's worth noting that I rewrote the Stats class to use Foxhole Labels and a custom texture for the font. The first, I think, is a bit faster than the Starling TextField. The second allows me to pull from a TextureAtlas, which helps keep the GPU working with only a single texture instead of swapping back and forth. That probably accounts for the differences we're seeing.

    My other branch of Foxhole (the foxhole-legacy project on Github) uses renderMode GPU and the display list. That gets about 25-26 fps when scrolling the list, if I remember correctly. When the app is idle, it runs at around 10+ fps higher than the Starling version.

    Posted 1 year ago #
  8. Andrius

    Expert Bird
    Joined: Apr '12
    Posts: 183

    Hello, it looks like these components are very cool, but I can't understand how to set them up. It drives me crazy, can someone please help me on JUST HOW TO SET THE UP WORKING?
    PLEZZ...

    Posted 1 year ago #
  9. killerspaz

    Competent Bird
    Joined: Mar '12
    Posts: 32

    @Josh, it's not a huge deal right now, as I'm still getting the FPS range I'm shooting for (although it's a super simple app right now), but I noticed whenever I have a bunch of components on the screen (I've got about 60 right now) FPS jumps down to around 45.

    Moving the mouse anywhere on the stage makes it jump even lower to around 30.
    This is on the desktop.

    I don't plan on having that many in the final app, it's just for testing things in my app right now, but I haven't tried it on the tablet to see how it responds.

    Figured I'd throw that out there, don't know if there's a ton of processing Touch events somewhere going haywire.

    *****EDIT******
    Just tried it on my Atrix, and when not touching anything it's at a steady 29fps... when I touch the screen, it goes as low as 2fps :S Hopefully won't be a big deal once I clean up the UI

    Posted 1 year ago #
  10. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    @Andrius123, please look at the foxhole-starling-examples for some code examples to help get you started. You'll need Starling too, of course, and there are two other dependencies: GTween 2.01 and as3-signals 0.9 BETA. All of these libraries need to be in your source path to get a Foxhole app to compile.

    Posted 1 year ago #
  11. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    @killerspaz Wow, I haven't made anything with that many components at once. I wonder if the FPS drop is something in Foxhole, or if you're hitting performance limits in Starling.

    Also, are you using a TextureAtlas to share the same skin textures on all of those components?

    Posted 1 year ago #
  12. killerspaz

    Competent Bird
    Joined: Mar '12
    Posts: 32

    Yeah it's a TextureAtlas... It's actually using your MinimalTheme setup for the time being.

    As a demo, I've created the following project: http://dl.dropbox.com/u/1143608/junk/delete/StarlingStressTest.zip

    Let me know if you have any issues with that, I used to have issues importing mobile projects.

    Needs Starling, Foxhole Components, and MinimalTheme.
    I included my own texture map from another app to supply basic texture for up state button.

    On my desktop, Starling buttons stay around 59-60fps when moving rapidly and clicking like crazy.

    The Foxhole buttons go as low as 31fps for me.

    Hope this helps demonstrate it!

    For the time being, I'm moving forward with using Foxhole components, they're way more convenient than starling's

    Posted 1 year ago #
  13. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    Thanks for that, killerspaz. I'll try to use the stress test to do some profiling and try out some alternative approaches to how skins are handled.

    Posted 1 year ago #
  14. Andrius

    Expert Bird
    Joined: Apr '12
    Posts: 183

    Hello, can anyone help me to set up the project with those components. It really drives me crazy because I don't even know how to set up the project with working components.

    Posted 1 year ago #
  15. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    @Andrius123 I tried to help above. Did you see my post? Please be more specific about what isn't working for you. Are you seeing specific compiler errors that we might be able to help with?

    Edit: Also check out the Setting Up Foxhole for Starling in Flash Builder article. This provides more detailed information about setting up a project to use Foxhole for Starling.

    Posted 1 year ago #
  16. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    @killerspaz It's not exactly the most fair stress test. If you change the Foxhole buttons to use the same skin as the Starling buttons, the FPS goes way up. I'm guessing that the Scale9Images used by the Minimal theme are having an impact due to the fact that they each contain nine separate images.

    Posted 1 year ago #
  17. killerspaz

    Competent Bird
    Joined: Mar '12
    Posts: 32

    Heh yeah, meant to say it's not a 1 to 1 test cuz if skins, but my session expired and I lost the post... Forgot to readd that...

    Posted 1 year ago #
  18. Andrius

    Expert Bird
    Joined: Apr '12
    Posts: 183

    I'm reading the tutorial on how to set up a button control and I'm a bit confused about [Embed] metadata, so can anyone post me those couple lines of code with [embed] statements.

    Posted 1 year ago #
  19. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    @Andrius123 You can embed files like this:

    [Embed(source="pathToAtlasImage.png")]
    private static const EMBEDDED_ATLAS_BITMAP:Class;
     
    [Embed(source="pathToAtlasXml.xml",mimeType="application/octet-stream")]
    private static const EMBEDDED_ATLAS_XML:Class;
     
    [Embed(source="pathToFntFile.fnt",mimeType="application/octet-stream")]
    private static const EMBEDDED_FONT_XML:Class;
    Posted 1 year ago #
  20. Andrius

    Expert Bird
    Joined: Apr '12
    Posts: 183

    Hello,
    For some reason I can't use textFormat i always get this compiler error:1119: Access of possibly undefined property textFormat through a reference with static type org.josht.starling.foxhole.controls:Button. and if I delete this line

    button.textFormat = new BitmapFontTextFormat(font, NaN, 0x343434);

    I'm getting whole bunch of ActionScript errors at startup. The app starts and the button is added to the stage without any text and if I had attached event listener to button, it responds. But I still don't get what is going on ;(

    Posted 1 year ago #
  21. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    Use defaultTextFormat instead. I'll update the wiki doc, if it's wrong.

    Posted 1 year ago #
  22. xoria

    Hatchling
    Joined: Apr '12
    Posts: 2

    I am having issues compiling with Flash Develop 4 and Flex SDK 4.6, also have tried both latest and stable versions of Starling.

    It seems like the code is out of sync or something... with QuadBatch throwing an error.

    You can see the 3 errors here: http://i.imgur.com/xm941.jpg

    I got it to compile by commenting these 3 lines out but that disables text rendering.

    Any ideas?

    Love the project and looking forward to getting it working!

    Posted 1 year ago #
  23. Jeff

    Moderating Owl
    Joined: Nov '11
    Posts: 1,285

    Looks like you pulled the very latest foxhole-starling from github. You have to use the very latest starling sources from github too for them to be compatible:

    https://github.com/PrimaryFeather/Starling-Framework

    both were updated earlier today with API updates to QuadBatch among other changes

    Posted 1 year ago #
  24. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    Oops! I've actually always intended to stay in sync with the latest versioned build of Starling rather than the cutting edge. I guess I got too excited about the text performance enhancements Daniel pushed to Starling earlier today. They help an awful lot to improve frame rates. Looks like this means that Foxhole now requires at least the revision of Starling from April 14th.

    (and now I need to fix those bugs Jeff submitted that relate to post-1.0 features...)

    Posted 1 year ago #
  25. xoria

    Hatchling
    Joined: Apr '12
    Posts: 2

    Got it, not sure why it did'nt before I was using latest Starling/Foxhole src.. anyway heh it works great now.

    Quick question, So I saw a start for a layout engine above however what is the current state of the RESIZE event within Starling? As in could we make "responsive" layouts which redraw when user changes size of stage? This is really helpful to have for doing layouts that could adapt per mobile, desktop and web etc...

    Posted 1 year ago #
  26. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    Are you asking if ResizeEvent.RESIZE works? Yes, it does. You need to manually adjust the viewPort bounds along with the stageWidth and stageHeight values, though. There should be some sample code on the forums.

    On a related note, you can listen to a FoxholeControl's onResize signal to adjust your layout whenever a component resizes.

    Posted 1 year ago #
  27. droweed

    Novice Bird
    Joined: Apr '12
    Posts: 9

    Hi Josh, really liking the ui components so far, I'm currently doing sample apps using foxhole, I got to the part of modifying the skins, and I kinda got stuck on the process of using my own fonts, Am I right in assuming you'll create the bitmap font via the sample procedure as the other textures? using texture packer and let it generate the appropriate tags, I've delved into the minimal font(pf_ronda_seven.fnt), and it uses keycode instead... its kinda confusing xd

    so can you please create a tutorial on how to go about that? maybe on your wiki.. that would be awesome.

    edit: excuse me for the question, just got the answer myself via the api documentation on bitmapfont xd sorry

    Posted 1 year ago #
  28. pavel.fljot

    Senior Bird
    Joined: Mar '12
    Posts: 61

    @Josh Tynjala

    why do you have only a single invalidation queue? Has Flex team done 3 queues of invalidation (with different order directions) for nothing?

    Posted 1 year ago #
  29. Josh Tynjala

    Feathers Guru
    Joined: Feb '12
    Posts: 2,468

    @droweed Glad you figured it out.

    @pavel.fljot The Foxhole components were originally based on fl.core.UIComponent included with Flash Professional, which uses a single invalidation queue. This makes sense for components that don't measure themselves. However, today's Foxhole components now have measurement, so yes, I agree that a more robust invalidation system would be better. I have many things on my todo list for Foxhole, and optimizing this is among them.

    Posted 1 year ago #
  30. fabiobiondi

    Senior Bird
    Joined: Mar '12
    Posts: 66

    Hi Josh,
    after some time I have downloaded the last version of FoxHole and I have tested all again.

    Excelent work!!

    Following some probs I found (testing on desktop).
    Probably you already know them.

    MINIMAL_THEME
    - TITLEBAR: I oftem have problems with font quality (the same issue there was on other components but now fixed)
    - SLIDER: font issue on the label
    - TOGGLE SWITCH: font issue on both labels
    - on LIST EXAMPLE: I don't see the slider cursor for WIDTH and HEIGHT until I click on them once
    - PICKER LIST: font issue on the selected value

    AZURE THEME (applied on KITCHEN_SINK example):
    - SLIDER: vertical direction doesn't work (i don't see the bar)
    - on LIST EXAMPLE: Same issue of MINIMAL THEME described above

    Thanks a lot for your work
    Fabio

    Posted 1 year ago #

RSS feed for this topic

« Previous123…10Next »

Reply »

You must log in to post.

Gamua - Consistent Game Development across all Platforms